pub trait Tool: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn description(&self) -> &str;
fn parameters_schema(&self) -> Value;
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
ctx: ToolContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Tool trait for implementing various tools
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Human-readable description of the tool
Sourcefn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
JSON Schema for the tool’s parameters