Skip to main content

Module tool

Module tool 

Source
Expand description

Tools: the things an agent can actually do.

A tool is a name, a description, a JSON Schema, and an async function. The registry holds them; MCP servers and native Rust functions both land here as the same trait object, so the agent loop never learns the difference.

Modules§

ask
Asking the user a question, as a tool.
builtin
Built-in tools. No server required — these are ordinary Rust functions.
todo
A task list the agent maintains for itself.

Structs§

Capabilities
What a tool can do — the vocabulary MCP standardized (readOnly, destructive, openWorld) plus the two axes that decide whether an agent can be turned into an exfiltration tool.
CarriedState
A tool’s own state, on its way across a compaction.
ModeApprover
Answers from the configured PermissionMode without asking anyone.
Registry
ToolCtx
What a tool is allowed to touch.
ToolOutput

Enums§

Decision
The decision an approver hands back for one pending call.

Constants§

SPILL_FLOOR_BYTES
Floor under a result’s share of the turn budget. A wide batch must not starve every result down to a marker with no content: below this, the division stops and the total budget is allowed to overrun instead.

Traits§

Approver
Gates tool calls that aren’t read-only. The CLI implements this with a terminal prompt; a headless caller can auto-allow or auto-deny.
Tool

Functions§

cap_result
Cut an oversized tool result down to cap bytes, saving the full output where the model can get it back.