pub trait Tool: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn parameters_schema(&self) -> Value;
fn execute<'life0, 'async_trait>(
&'life0 self,
call: ToolCall,
) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn requires_confirmation(&self) -> bool { ... }
fn examples(&self) -> Vec<ToolExample> { ... }
}Expand description
Trait for all tools
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get the description of the tool
Sourcefn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
Get the JSON schema for the tool’s parameters
Provided Methods§
Sourcefn requires_confirmation(&self) -> bool
fn requires_confirmation(&self) -> bool
Check if the tool requires special permissions
Sourcefn examples(&self) -> Vec<ToolExample>
fn examples(&self) -> Vec<ToolExample>
Get examples of how to use this tool