Expand description
Tool trait, registry, context, and result types for agent function calling.
§Key types
| Type | Role |
|---|---|
Tool | Trait for tools callable by the agent (name, description, params, execute) |
ToolRegistry | Registry of available tools with aliases |
ToolContext | Per-invocation context passed to execute() |
ToolResult | Result of a tool execution returned to the LLM |
FileDiff | A file diff produced by a tool |
ForbiddenCmd | Command restriction pattern (regex-based) |
ToolGate | Host check every call passes before it runs |
Structs§
- Background
Request - A request to move a running tool call into the background.
- File
Diff - A file diff produced by a tool.
- Forbidden
Cmd - A forbidden command configuration.
- GateAsk
- A question a gate asked, and how long the call waits for its answer.
- Tool
Context - Per-invocation context passed to
Tool::executemethods. - Tool
Registry - Registry of tools available to an agent.
Enums§
- Diff
Line - A single line in a unified diff output.
- Gate
Answer - The answer to a
GateAsk. - Gate
Decision - What a
ToolGatedecides about one call. - Tool
Result - Result of a tool execution, returned by
Tool::executeand fed back to the LLM as a"role": "tool"message.
Traits§
- Command
Allow List - Trait for checking whether a command is allowed to execute.
- Interrupt
Payload - Typed payload for
ToolResult::Interrupt. - Tool
- Trait for tools that can be invoked by the agent.
- Tool
Gate - A host’s check on every tool call, made where the registry executes it.
Functions§
- parse_
args - Deserialize tool arguments from a serde_json::Value into a typed struct. Returns a typed error mentioning which tool failed to parse.