Annotation Interface Tool


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface Tool
Method annotation to define an MCP Tool. Tools Micronaut registers Tools singletons for beans with executable methods (e.g. methods in a class annotated with `@Singleton`) annotated with Tool. Forked from: https://github.com/quarkiverse/quarkus-mcp-server/blob/main/core/runtime/src/main/java/io/quarkiverse/mcp/server/Tool.java
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Additional hints for clients.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Additional hints for clients.
     
    Each tool must have a unique name.
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant value for name() indicating that the annotated element's name should be used as-is.
  • Field Details

    • ELEMENT_NAME

      static final String ELEMENT_NAME
      Constant value for name() indicating that the annotated element's name should be used as-is.
      See Also:
  • Element Details

    • name

      String name
      Each tool must have a unique name. By default, the name is derived from the name of the annotated method.
      Returns:
      "<<element name>>"
      Default:
      "<<element name>>"
    • title

      String title
      Returns:
      A human-readable title for the tool.
      Default:
      ""
    • description

      String description
      Returns:
      A human-readable description of the tool. A hint to the model.
      Default:
      ""
    • annotations

      Additional hints for clients.

      Note that the default value of this annotation member is ignored. In other words, the annotations have to be declared explicitly in order to be included in Tool metadata.

      Returns:
      Additional hints for clients.
      Default:
      @io.micronaut.mcp.annotations.Tool.ToolAnnotations