Expand description
Tool trait — the interface every callable tool implements.
The LLM sees tools via ToolSchema (name, description, JSON schema).
When the LLM emits a ToolCall, the engine looks up the tool by name
and calls Tool::execute with the args.
Two implementations ship with the library:
FunctionTool— wraps any async function as a tool- MCP adapter (future plan) — bridges external MCP servers
Structs§
- Function
Tool - Convenience wrapper: turns any async function into a
Tool. - Structured
Function Tool - Like
FunctionTool, but returns structuredToolResultwith metadata. - Tool
Result - Structured result from tool execution.
Traits§
- Tool
- A callable tool the LLM can invoke via tool_calls.
Type Aliases§
- Structured
Tool Func - Type alias for the async function returning a structured
ToolResult. - Tool
Func - Type alias for the async function signature used by
FunctionTool. - Tool
Future - Type-erased async future returned by
Tool::execute. - Tool
Result Future - Type-erased async future for structured tool results.