pub trait Tool: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn schema(&self) -> ToolSchema;
fn execute<'life0, 'async_trait>(
&'life0 self,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A tool that can be executed by an agent.
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Returns a human-readable description of what this tool does.
Sourcefn schema(&self) -> ToolSchema
fn schema(&self) -> ToolSchema
Returns the JSON Schema describing the tool’s parameters.