pub trait Tool: Send + Sync {
// Required methods
fn schema(&self) -> ToolSchema;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 ExecutionContext,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn validate(&self, _arguments: &Value) -> Result<(), ToolError> { ... }
}Expand description
Tool/function trait
Required Methods§
Sourcefn schema(&self) -> ToolSchema
fn schema(&self) -> ToolSchema
Get tool schema