Interface ToolDescriptor

All Superinterfaces:
HasMeta, ServerFeature.Descriptor

@Immutable public interface ToolDescriptor extends ServerFeature.Descriptor, HasMeta
Descriptor for a server-provided tool.
  • Method Details

    • name

      String name()
      The tool name, unique within the server.
      Specified by:
      name in interface ServerFeature.Descriptor
    • title

      @Nullable String title()
      Optional human-readable title.
    • description

      @Nullable String description()
      Optional description of this tool.
    • inputSchema

      @Nullable JsonSchema inputSchema()
      Optional JSON schema describing the tool's input arguments.
    • outputSchema

      @Nullable JsonSchema outputSchema()
      Optional JSON schema describing the tool's output.
    • taskSupport

      @Nullable TaskSupport taskSupport()
      Optional declaration of this tool's support for long-running tasks.
    • annotations

      @Nullable ToolAnnotations annotations()
      Optional behavioral annotations (e.g. read-only, destructive) for this tool.
    • icons

      @Nullable List<Icon> icons()
      Optional icons for this tool.
    • extensionId

      @Nullable String extensionId()
      Optional identifier of the extension that owns this tool.
    • meta

      @Nullable Map<String,Object> meta()
      Optional protocol extension metadata.
      Specified by:
      meta in interface HasMeta
      Returns:
      the metadata map, or null if none
    • check

      @Check default void check()
      Validates the tool descriptor's name.
      Throws:
      IllegalArgumentException - if the name is blank
    • builder

      static ToolDescriptor.Builder builder()
      Creates a new builder for ToolDescriptor.
    • of

      static ToolDescriptor of(String name)
      Creates a tool descriptor with just a name.
    • of

      static ToolDescriptor of(String name, @Nullable String description)
      Creates a tool descriptor with a name and description.