Annotation Type McpTool
Publishes this method of a bean as a tool on the server's MCP endpoint, so an agent can call it.
The build writes the tool's JSON Schema from the parameter types and a
dispatcher that converts the call's arguments and invokes the method
directly. The parameters may be strings, numbers, booleans, or maps and lists
of those; each needs McpParam to name it, because a Java parameter name does
not survive compilation. The result is written with
Json.
The endpoint is at cn1.mcp.path (default /mcp). Outside a development
profile it requires cn1.mcp.token and refuses to start without one, because
a tool reachable by anyone is a vulnerability rather than a feature.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
name
-
description
String descriptionWhat the tool does. Agents choose tools by this text, so say when to use it, not only what it is.
-