pub enum ToolClass {
Mcp,
SelfControl,
Code,
}Expand description
The two classes of tool the agentic loop offers the model — the boundary that keeps agentd honest to target principle 1 (tools come ONLY from registered MCP servers) and principle 2 (no local code/command execution). EVERY tool in the loop’s catalogue is exactly one of these; there is no third “general capability library”.
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 (RFC 0022 §4): 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 (a server cannot steal a registered tool’s calls).
Trait Implementations§
impl Copy for ToolClass
impl Eq for ToolClass
impl StructuralPartialEq for ToolClass
Auto Trait Implementations§
impl Freeze for ToolClass
impl RefUnwindSafe for ToolClass
impl Send for ToolClass
impl Sync for ToolClass
impl Unpin for ToolClass
impl UnsafeUnpin for ToolClass
impl UnwindSafe for ToolClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more