public static class McpServerFeatures.AsyncToolSpecification extends Object
Example tool specification:
new McpServerFeatures.AsyncToolSpecification(
new Tool(
"calculator",
"Performs mathematical calculations",
new JsonSchemaObject()
.required("expression")
.property("expression", JsonSchemaType.STRING)
),
(exchange, args) -> {
String expr = (String) args.get("expression");
return Mono.fromSupplier(() -> evaluate(expr))
.map(result -> new CallToolResult("Result: " + result));
}
)
| Constructor and Description |
|---|
AsyncToolSpecification() |
| Modifier and Type | Method and Description |
|---|---|
static McpServerFeatures.AsyncToolSpecification |
fromSync(McpServerFeatures.SyncToolSpecification tool) |
public static McpServerFeatures.AsyncToolSpecification fromSync(McpServerFeatures.SyncToolSpecification tool)
Copyright © 2025. All rights reserved.