Skip to main content

Module tool

Module tool 

Source
Expand description

Tool trait. All tools implement this single trait.

Re-exports§

pub use crate::context::config::PathStyle;
pub use crate::permission::PermissionMode;

Structs§

CallTraits
What a tool says about one call: answered by Tool::call_traits, which is handed the call’s input.
Disposer
A handle that withdraws one registration.
Entry
A registered tool plus the id its Disposer refers to.
FileChange
One file a tool call wrote, as tool_result reports it to the host.
InMemoryToolRegistry
LayeredToolRegistry
A registry that layers one set of tools over another.
McpMeta
ProgressSender
What a tool call reports progress through. The engine hands every call one that reaches the session’s event stream as AgentEvent::ToolProgress, rate-limited per call; reports after the call returns are dropped.
ProgressUpdate
One progress report of a running tool call. progress and total are in whatever unit the tool counts (lines, bytes, steps); either may be absent.
PromptContext
RegistrationId
Identifies one registration, so it can be withdrawn without disturbing anything else that happens to share the tool’s name.
ToolContext
ToolResult
ToolResultBlock
ToolSpec
What a tool says about itself that holds for every call. Built with ToolSpec::new and the setters: ToolSpec::new().read_only(true).
TurnScope
What belongs to the one turn a call is made in, and ends with it.

Enums§

DiffOmitted
FileOp
ToolOrigin
Where a tool came from, for crate::interface::model::ToolDef::source.
ToolResultContent
ValidationResult

Constants§

MAX_IMAGE_BYTES
Largest image, decoded, that goes to the model as one image block. The API refuses an image over 5 MB of base64 — 3.75 MB decoded — and the refused request would carry it again on every later turn; rounded down to leave room for the rest of the request.

Traits§

ProgressCallback
Tool
A tool the model can call.
ToolRegistry

Functions§

compact_schema
schema as sent to the model: the same parameters, without what schema generators add for other readers — the root $schema and title, "default": null, Rust integer formats, and per-variant descriptions on an enum of string constants (which becomes a plain enum).