Class PromptRegistry

java.lang.Object
io.micronaut.mcp.server.registry.PromptRegistry

@Requires(beans=McpServerConfiguration.class) @Named @Internal @Singleton public final class PromptRegistry extends Object
The registry of Prompts.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    protected final List<io.micronaut.mcp.server.registry.AbstractMcpMethodRegistry.Method<Object>>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    addMethod(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?,?> method)
    Adds a new method to the registry by associating it with a given bean definition.
    protected final Stream<io.micronaut.mcp.server.registry.AbstractMcpMethodRegistry.Method<Object>>
    Returns a stream of the methods currently stored in the registry.
    List<io.modelcontextprotocol.server.McpServerFeatures.AsyncPromptSpecification>
     
    List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncPromptSpecification>
     
    List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification>
     
    List<io.modelcontextprotocol.server.McpServerFeatures.SyncPromptSpecification>
     
    boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • getSyncSpecs

      public List<io.modelcontextprotocol.server.McpServerFeatures.SyncPromptSpecification> getSyncSpecs()
    • getAsyncSpecs

      public List<io.modelcontextprotocol.server.McpServerFeatures.AsyncPromptSpecification> getAsyncSpecs()
    • getStatelessSyncSpecs

      public List<io.modelcontextprotocol.server.McpStatelessServerFeatures.SyncPromptSpecification> getStatelessSyncSpecs()
    • getStatelessAsyncSpecs

      public List<io.modelcontextprotocol.server.McpStatelessServerFeatures.AsyncPromptSpecification> getStatelessAsyncSpecs()
    • isNotEmpty

      public boolean isNotEmpty()
    • addMethod

      public final void addMethod(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?,?> method)
      Adds a new method to the registry by associating it with a given bean definition.
      Parameters:
      beanDefinition - the bean definition that declares or provides the method
      method - the executable method to be added to the registry
    • drainMethods

      protected final Stream<io.micronaut.mcp.server.registry.AbstractMcpMethodRegistry.Method<Object>> drainMethods()
      Returns a stream of the methods currently stored in the registry. After the stream is consumed or closed, the underlying list of methods will be cleared.
      Returns:
      a stream of methods from the registry