Expand description
Typed tool definition framework and dispatch router. Typed tool definition framework.
Provides the ToolHandler trait for implementing tools as named types,
and ToolHandlerRouter for automatic dispatch of tool calls within a
SessionHandler.
Enable the derive feature for schema_for, which generates JSON
Schema from Rust types via schemars.
Structs§
- Tool
Handler Router - A
SessionHandlerthat dispatches tool calls to registeredToolHandlerimplementations by name.
Traits§
- Json
Schema - Re-export of
schemars::JsonSchemafor deriving tool parameter schemas. A type which can be described as a JSON Schema document. - Tool
Handler - A client-defined tool with its handler logic.
Functions§
- define_
tool - Define a tool from an async function (or closure) that takes a typed,
JsonSchema-derived parameter struct. - schema_
for - Generate a JSON Schema
Valuefrom a Rust type. - tool_
parameters - Convert a JSON Schema
Valueinto theTool::parametersmap shape expected by the protocol. - try_
tool_ parameters - Fallible variant of
tool_parametersfor callers handling dynamic schema input.
Derive Macros§
- Json
Schema - Re-export of
schemars::JsonSchemafor deriving tool parameter schemas. Derive macro forJsonSchematrait.