tool_with_schema

Function tool_with_schema 

Source
pub fn tool_with_schema<F, Fut>(
    name: impl Into<String>,
    description: impl Into<String>,
    schema: ToolInputSchema,
    handler: F,
) -> impl ToolHandler
where 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 name
  • description - Tool description
  • schema - Input schema for the tool
  • handler - Async closure that handles tool calls