Expand description
Tool abstraction (AgentTool trait) and the permission gate hook.
Structs§
- Allow
AllGate - A gate that permits every call.
- Before
Tool Call Result - Result of a
beforeToolCallcheck. - Tool
Call Context - Context handed to a
ToolGatebefore a tool runs. - Tool
Result - The structured result of executing a tool.
contentis what the model sees.
Enums§
- Execution
Mode - How tool calls within a single assistant message are executed.
Traits§
- Agent
Tool - A tool the agent can call.
prepare_argumentslets a tool normalize raw model arguments before validation (e.g. the edit tool accepting a legacyoldText/newTextshape). - Tool
Gate - Hook that may block a tool call (e.g. ask the user for permission).
Functions§
- allow_
all_ gate - validate_
required - Lightweight required-field validation against a JSON schema. Ensures keys
listed in
requiredare present (non-null) before a tool runs.