Skip to main content

Module tool

Module tool 

Source
Expand description

Tool abstraction (AgentTool trait) and the permission gate hook.

Structs§

AllowAllGate
A gate that permits every call.
BeforeToolCallResult
Result of a beforeToolCall check.
ToolCallContext
Context handed to a ToolGate before a tool runs.
ToolResult
The structured result of executing a tool. content is what the model sees.

Enums§

ExecutionMode
How tool calls within a single assistant message are executed.

Traits§

AgentTool
A tool the agent can call. prepare_arguments lets a tool normalize raw model arguments before validation (e.g. the edit tool accepting a legacy oldText/newText shape).
ToolGate
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 required are present (non-null) before a tool runs.