Skip to main content

Module tool

Module tool 

Source
Expand description

Tool layer for the harness.

In the recursive architecture the Tool trait is the universal call boundary that makes recursion uniform: a tool can be a plain function, but it can equally be an entire other agentcrate::harness::subagent::SubAgentTool implements Tool, so “a model calling a model” is just “a model calling a tool”. Everything the agent loop can invoke flows through this layer and its ToolRegistry.

See [types] for definitions. This module provides constructors and the ToolRegistry logic for registering and looking up tools by name.

Structs§

SchemaCleanr
JSON Schema cleaner optimized for model tool-calling declarations.
ToolAccess
Access requirements a tool declares before it can be exposed or run.
ToolCall
A request from the model to invoke a tool.
ToolDelta
An incremental progress update emitted while a tool runs (streaming).
ToolDisplay
Human-facing presentation metadata for a tool invocation.
ToolExecutionContext
Live run context visible to a tool invoked by an agent loop.
ToolPolicy
SDK-owned safety and runtime metadata attached to a Tool.
ToolRegistry
A name-keyed registry of tools available to the harness.
ToolResult
The outcome of executing a ToolCall.
ToolRuntime
Runtime requirements a tool declares for safe execution.
ToolSchema
A model-visible declaration of a tool: its name, description, JSON-schema-compatible parameter shape, and preferred tool-call format.
ToolSideEffects
Declared side effects a tool may cause.

Enums§

CleaningStrategy
Schema cleaning strategies for different LLM providers.
SandboxMode
How strictly a tool must be sandboxed when it executes.
ToolFormat
The model-visible syntax a tool declaration prefers.
ToolTimeout
How the harness should bound a single tool invocation in wall-clock time.
WorkspaceAccess
How a tool is allowed to reach the caller’s workspace / filesystem root.

Constants§

GEMINI_UNSUPPORTED_KEYWORDS
Keywords that Gemini rejects for tool schemas.

Traits§

Tool
A tool the harness can invoke during an agent loop.

Functions§

context_detail_from_args
Extracts a compact human-facing detail from common tool argument keys.
humanize_tool_name
Derives a title-cased human-readable label from a raw tool name.