public static class McpServerFeatures.SyncToolSpecification.Builder
extends java.lang.Object
构造器和说明 |
---|
Builder() |
限定符和类型 | 方法和说明 |
---|---|
McpServerFeatures.SyncToolSpecification |
build()
Builds the SyncToolSpecification instance.
|
McpServerFeatures.SyncToolSpecification.Builder |
callHandler(java.util.function.BiFunction<McpSyncServerExchange,McpSchema.CallToolRequest,McpSchema.CallToolResult> callHandler)
Sets the call tool handler function.
|
McpServerFeatures.SyncToolSpecification.Builder |
tool(McpSchema.Tool tool)
Sets the tool definition.
|
public McpServerFeatures.SyncToolSpecification.Builder tool(McpSchema.Tool tool)
tool
- The tool definition including name, description, and parameter
schemapublic McpServerFeatures.SyncToolSpecification.Builder callHandler(java.util.function.BiFunction<McpSyncServerExchange,McpSchema.CallToolRequest,McpSchema.CallToolResult> callHandler)
callHandler
- The function that implements the tool's logicpublic McpServerFeatures.SyncToolSpecification build()
java.lang.IllegalArgumentException
- if required fields are not set