pub trait ToolHandler: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn gate_set(&self) -> &'static [GateId];
fn call(&self, params: Value) -> Result<Value, ToolError>;
}Expand description
A single MCP tool that can be dispatched by the ToolRegistry.
Implementors must be Send + Sync because the registry may be held across
thread boundaries in future async-capable transports.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
The JSON-RPC method name this handler responds to.
Must be unique across all handlers registered in the same
[ToolRegistry]. The convention is cortex_<verb>.
Sourcefn gate_set(&self) -> &'static [GateId]
fn gate_set(&self) -> &'static [GateId]
Gate IDs this tool activates.
Must be non-empty. ToolRegistry::register asserts this at
registration time (DA-3).