Record Class McpServerFeatures.AsyncToolSpecification

java.lang.Object
java.lang.Record
io.modelcontextprotocol.server.McpServerFeatures.AsyncToolSpecification
Record Components:
tool - The tool definition including name, description, and parameter schema
call - Deprecated. Use the callHandler instead.
callHandler - The function that implements the tool's logic, receiving a McpAsyncServerExchange and a McpSchema.CallToolRequest and returning results. The function's first argument is an McpAsyncServerExchange upon which the server can interact with the connected client. The second arguments is a map of tool arguments.
Enclosing class:
McpServerFeatures

public static record McpServerFeatures.AsyncToolSpecification(McpSchema.Tool tool, BiFunction<McpAsyncServerExchange,Map<String,Object>,reactor.core.publisher.Mono<McpSchema.CallToolResult>> call, BiFunction<McpAsyncServerExchange,McpSchema.CallToolRequest,reactor.core.publisher.Mono<McpSchema.CallToolResult>> callHandler) extends Record
Specification of a tool with its asynchronous handler function. Tools are the primary way for MCP servers to expose functionality to AI models. Each tool represents a specific capability.