Package io.meeds.mcp.server.model
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Constructor Summary
ConstructorsConstructorDescriptionSimpleToolDefinition(SimpleToolDefinition simpleToolDefinition) Copies a definition, its icon and its unknown keys included.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. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUnknownProperty(String key, Object value) Collects a key of the JSON entry that no field of this model maps.name()title()
-
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 nametitle- the readable titledescription- the description given to the modelinputSchema- the JSON schema of the argumentsrequireApproval- whether a call asks the user firstdisabled- whether the tool is switched offannotations- the MCP hints, or null
-
SimpleToolDefinition
Copies a definition, its icon and its unknown keys included.- Parameters:
simpleToolDefinition- the definition to copy
-
-
Method Details
-
name
- Specified by:
namein interfaceorg.springframework.ai.tool.definition.ToolDefinition
-
description
- Specified by:
descriptionin interfaceorg.springframework.ai.tool.definition.ToolDefinition
-
title
-
inputSchema
- Specified by:
inputSchemain interfaceorg.springframework.ai.tool.definition.ToolDefinition
-
addUnknownProperty
Collects a key of the JSON entry that no field of this model maps.- Parameters:
key- the unknown keyvalue- its value
-
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
-