pub trait Tool<Ctx>: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn input_schema(&self) -> Value;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 ToolContext<Ctx>,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn tier(&self) -> ToolTier { ... }
}Expand description
Definition of a tool that can be called by the agent
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Human-readable description of what the tool does
Sourcefn input_schema(&self) -> Value
fn input_schema(&self) -> Value
JSON schema for the tool’s input parameters