Skip to main content

Module tool

Module tool 

Source
Expand description

Agent tools + registry. Port of the reusable shape of agent_core/tools/.

A tool exposes a JSON-Schema interface to the model and an async implementation. The registry resolves the name the model emits in a tool_call to an implementation, exposes the LLM-facing specs, and runs the call. Domain tools live in a product crate and register here.

Modules§

support
Helpers for implementing Tool.

Structs§

CancellationToken
Hierarchical cancellation flag. Cancelling a parent cancels every child; cancelled resolves without polling.
ToolExecutionContext
Identity, position and controls for one tool execution.
ToolMeta
Static execution metadata for a tool.
ToolRegistry
Registry of tools available to an agent.

Enums§

ToolConcurrency
Whether a tool may run alongside others in one step.
ToolSurface
Who may call a tool.

Traits§

Tool
A callable tool. parameters is a JSON-Schema object describing the args.

Functions§

model_tool_name
Model-facing tool name (dots become underscores).
validate_json_schema
Validate value against schema.
validate_json_schema_definition
Check that schema is a valid JSON Schema.
validate_json_schema_value
Validate value against schema, labelling errors with subject.