Helpers that format MCP resource/prompt content for safe injection into the
model context. All server-origin content is wrapped with an
trust="untrusted-external" provenance marker and run through the existing
secret-scrubbing/length-bounding used elsewhere for server-controlled text.
Agent-loop tool that spawns an ephemeral SubAgent inheriting the
parent’s identity, security policy, and memory allowlist, runs a
focused prompt, and returns the response. Cron’s JobType::Agent
dispatch is the other SubAgent spawn site; both funnel through
Per-conversation mutable state tracking which deferred tools have been
activated (i.e. their full schemas have been fetched via tool_search).
The agent loop consults this each iteration to decide which tool_specs
to include in the LLM request.
Bundled return values from tool registry construction.
Named struct to avoid an ever-growing positional tuple that’s painful
to destructure across many callers.
Tool that runs a single prompt through an LLM and optionally validates
the response against a JSON Schema. No tools are provided to the LLM —
this is a pure text-in, text-out (or JSON-out) call.
A zeroclaw Tool backed by an MCP server tool.
The prefixed_name (e.g. filesystem__read_file) is what the agent loop
sees. The registry knows how to route it to the correct server.
Tool for interacting with the Notion API — query databases, read/create/update pages,
and search the workspace. Each action is gated by the appropriate security operation
(Read for queries, Act for mutations).
Send a message to a peer on a shared channel. Bound to a single
calling agent’s alias; the tool validates every send against that
agent’s resolved peer set.
Resets a session by clearing its message history. The session key
remains valid for new messages. Useful for cleaning up stale
conversations without deleting the session entry itself.
Returns the session key and metadata for the currently active session.
Reads the session key from the TOOL_LOOP_SESSION_KEY task-local,
which is scoped around gateway and channel agent turns.
Text browser tool: renders web pages as plain text using text-based browsers
(lynx, links, w3m). Ideal for headless/SSH environments where graphical
browsers are unavailable.
Live task tracker tool. Models call this with the COMPLETE current
todo list on every invocation (whole-list replace). The tool only
validates and normalizes; the tool-execution layer emits the
resulting TurnEvent::Plan.
Typed tool output. The LLM-facing string is derived from the structured
value exactly once, at construction, so the two can never drift. Deref to
str keeps every text read site working on the rendered form.
Web search tool for searching the internet.
Supports multiple model_providers: DuckDuckGo (free), Brave (requires API key),
Tavily (requires API key), SearXNG (self-hosted, requires instance URL),
Jina AI (requires API key), Bocha AI (requires API key, Chinese-friendly).
Re-entrant agent-spawning tools that must never be collapsed by the
per-turn duplicate-call guard: launching several with the same prompt
(redundancy, sampling, fan-out) is intentional, not an accidental
repeat. Unioned with config-provided exemptions in the tool-call loop.
Build the <available-deferred-tools> section for the system prompt.
Lists only tool names so the LLM knows what is available without
consuming context window on full schemas. Includes an instruction
block that tells the LLM to call tool_search to activate them.
Build the two generic MCP capability tools (mcp_resources, mcp_prompts),
including each only when the access policy admits its name. A None policy
admits both. Returned as Arc<dyn Tool> ready to register and/or expose to
delegates.
Register skill-defined tools with full context for builtin kinds.
unfiltered_registry provides the pre-policy tool list for kind = "builtin"
delegation.
Resolves the peer groups that include the active agent, read live from config
at call time so a config reload (membership / external_peers / channel alias /
output_modality) takes effect without rebuilding the tool registry.
Handle to one turn’s routing state. The orchestrator creates a fresh handle
before each run_tool_call_loop call, scopes it into TURN_ROUTING for the
duration of the loop, and reads it back after the loop completes.