pub fn tool_with_schema<F, Fut>(
name: impl Into<String>,
description: impl Into<String>,
schema: ToolInputSchema,
handler: F,
) -> impl ToolHandlerwhere
F: Fn(CallToolRequest, RequestContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ServerResult<CallToolResult>> + Send + 'static,Expand description
Create a tool handler with a custom schema
This allows specifying the input schema for the tool, which is used by
the #[server] macro to provide type-safe tool definitions.
ยงArguments
name- Tool namedescription- Tool descriptionschema- Input schema for the toolhandler- Async closure that handles tool calls