Class SimpleToolDefinition

java.lang.Object
io.meeds.mcp.server.model.SimpleToolDefinition
All Implemented Interfaces:
org.springframework.ai.tool.definition.ToolDefinition

public class SimpleToolDefinition extends Object implements org.springframework.ai.tool.definition.ToolDefinition
One MCP tool definition, as shipped in an ai-tool-definitions.json file and as persisted with the administrator's edits. A key this model does not know does not fail the parsing: it is collected in unknownPropertyNames(), so the reader decides what the entry is worth. A misspelled require_approval or annotations key would otherwise leave the field at its permissive default.
  • Constructor Details

    • SimpleToolDefinition

      public SimpleToolDefinition(String name, String title, String description, String inputSchema, boolean requireApproval, boolean disabled, io.modelcontextprotocol.spec.McpSchema.ToolAnnotations annotations)
      Builds a definition with no icon.
      Parameters:
      name - the tool name
      title - the readable title
      description - the description given to the model
      inputSchema - the JSON schema of the arguments
      requireApproval - whether a call asks the user first
      disabled - whether the tool is switched off
      annotations - the MCP hints, or null
    • SimpleToolDefinition

      public SimpleToolDefinition(SimpleToolDefinition simpleToolDefinition)
      Copies a definition, its icon and its unknown keys included.
      Parameters:
      simpleToolDefinition - the definition to copy
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface org.springframework.ai.tool.definition.ToolDefinition
    • description

      public String description()
      Specified by:
      description in interface org.springframework.ai.tool.definition.ToolDefinition
    • title

      public String title()
    • inputSchema

      public String inputSchema()
      Specified by:
      inputSchema in interface org.springframework.ai.tool.definition.ToolDefinition
    • addUnknownProperty

      public void addUnknownProperty(String key, Object value)
      Collects a key of the JSON entry that no field of this model maps.
      Parameters:
      key - the unknown key
      value - its value
    • unknownPropertyNames

      public Set<String> unknownPropertyNames()
      Returns:
      the keys of the JSON entry that this model does not know, in their order in the entry, empty when there are none