pub trait Tool: Send + Sync {
// Required methods
fn definition(&self) -> &ToolDefinition;
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn name(&self) -> &str { ... }
fn validate(&self, args: &Value) -> Result<()> { ... }
}Expand description
Trait for executable tools.
Required Methods§
Sourcefn definition(&self) -> &ToolDefinition
fn definition(&self) -> &ToolDefinition
Get the tool definition.