Package su.onno.mcp
Annotation Interface McpTool
Exposes a Spring bean method as an MCP tool.
Ordinary method parameters become tool inputs. A Principal,
McpToolContext, or MCP server exchange parameter is supplied by the starter and
is not included in the input schema.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDescription shown to MCP clients.booleanMCP destructive safety hint.booleanMCP idempotent safety hint.Tool name advertised to MCP clients.booleanMCP open-world safety hint.Optional JSON Schema for the returned value.booleanMCP read-only safety hint.String[]Roles allowed to call the tool.Short human-readable title.
-
Element Details
-
name
String nameTool name advertised to MCP clients. Defaults to the Java method name.- Default:
""
-
title
String titleShort human-readable title. Defaults to the tool name.- Default:
""
-
description
String descriptionDescription shown to MCP clients.- Default:
""
-
roles
String[] rolesRoles allowed to call the tool. Empty means any authenticated user.- Default:
{}
-
readOnly
boolean readOnlyMCP read-only safety hint. Non-read-only tools obeyonno.mcp.writes-enabled.- Default:
true
-
destructive
boolean destructiveMCP destructive safety hint.- Default:
false
-
idempotent
boolean idempotentMCP idempotent safety hint.- Default:
false
-
openWorld
boolean openWorldMCP open-world safety hint.- Default:
false
-
outputSchema
String outputSchemaOptional JSON Schema for the returned value.- Default:
""
-