public static class McpServerFeatures.SyncToolSpecification extends 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));
}
)
Copyright © 2025. All rights reserved.