pub trait Tool: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn schema(&self) -> Value;
fn capabilities_required(&self) -> Vec<SkillCapability>;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Value,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for executable tools that the agent can invoke.
Tools are registered in a ToolRegistry and matched to LLM tool calls.
Each tool declares its capabilities so the security layer can enforce
permission boundaries.
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Human-readable description for the LLM.
Sourcefn capabilities_required(&self) -> Vec<SkillCapability>
fn capabilities_required(&self) -> Vec<SkillCapability>
Capabilities this tool requires (used for WASM sandbox enforcement).
Sourcefn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Value,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Value,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with the given input and context.