pub enum ToolClass {
Mcp,
SelfControl,
Code,
}Expand description
The classes of tool the agentic loop offers the model. This boundary is what keeps two invariants true: a task tool reaches the model ONLY by being exported from a registered MCP server or registered in code by the embedder, and nothing in the catalogue shells out to a local command. EVERY tool the loop advertises is exactly one of these classes; there is no third “general capability library” that could smuggle in an unaudited capability.
Mcp— a tool discovered from a connected MCP server (tools/list). Dispatched by routing the call BACK to its owning server (dispatch_tool); agentd never runs it locally.SelfControl— agentd’s OWN orchestration primitives (seeSELF_CONTROL_TOOLS): delegation (subagent.*,a2a.delegate), reactivity (root-onlyschedule/subscribe/unsubscribe), and resource attention (resource.read). These are handled in-process by aSelfHandler/ the runner — NONE shells out. This is the named “self/control” class: the agent’s own control surface, structurally distinct from the MCP task-tool catalogue (a different code path assembles each).
Variants§
Mcp
A tool from a connected MCP server; dispatched back to that server.
SelfControl
One of agentd’s own self/control orchestration primitives; handled in-process.
Code
A CODE-REGISTERED tool: native Rust the embedder registered via
crate::tools::register — first-party by definition, dispatched
in-process, and it WINS a name collision with a remote MCP tool, so a
server cannot steal a registered tool’s calls by claiming its name.