Expand description
Tool: external capabilities an agent can invoke.
This file is where Tool is defined: the Tool trait defines the
interface agents use to execute tools, ToolSchema describes the
definition exposed to the model, ToolError describes why a call
fails; it contains no concrete tools — those are implemented by agent
applications (see examples/tool_agent.rs).
Companion component:
SharedState— a container for cross-tool shared state, injected viaToolContextonTool::call.
Structs§
- Shared
State - Shared state: a heterogeneous container accessed by type.
- Tool
Context - Context passed to a tool call.
- Tool
Namespace - Namespace assigned to a tool by the host application or extension layer.
- Tool
Output - Model-visible output produced by a tool.
- Tool
Policy - Tool policy metadata declared by the tool author.
- Tool
Schema - The definition of a tool.
- Tool
Source - Host-facing metadata describing where a provider-visible tool came from.
Enums§
- Side
Effect Level - Declared side-effect level for a tool.
- Tool
Error - Reasons a tool call fails.
- Tool
Memory Policy - Memory handling policy for model-visible tool/effect output.
- Tool
Namespace Kind - Kind of tool namespace.
- Tool
Result - Result of a tool call.
- Tool
Trust Level - Trust level assigned to a tool source.
Traits§
- Tool
- A tool an agent can invoke.