public static class McpServerFeatures.SyncToolSpecification
extends java.lang.Object
Example tool specification:
new McpServerFeatures.SyncToolSpecification(
new Tool(
"calculator",
"Performs mathematical calculations",
new JsonSchemaObject()
.required("expression")
.property("expression", JsonSchemaType.STRING)
),
(exchange, args) -> {
String expr = (String) args.get("expression");
return new CallToolResult("Result: " + evaluate(expr));
}
)
构造器和说明 |
---|
SyncToolSpecification() |