pub trait Tool: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn gana(&self) -> Gana;
fn effects(&self) -> &EffectRow;
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
args: Args,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn stats(&self) -> &ToolStats;
// Provided methods
fn description(&self) -> &str { ... }
fn input_schema(&self) -> Value { ... }
}Expand description
The core tool trait. Every WhiteMagic tool implements this.
Tools declare their Gana affiliation and effect row, then implement
the call method. The dispatch pipeline handles routing, governance,
and statistics tracking.
Required Methods§
Provided Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Human-readable description.
Sourcefn input_schema(&self) -> Value
fn input_schema(&self) -> Value
JSON-Schema-style description of the accepted arguments.
Defaults to an empty object (no schema). Curated tools override this
so tools.list can show clients the argument contract.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".