pub trait Tool: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn parameters(&self) -> Value;
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn validate_params(&self, params: &Value) -> Vec<String> { ... }
fn to_schema(&self) -> Value { ... }
}Expand description
Trait for tools.
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get the tool description.
Sourcefn parameters(&self) -> Value
fn parameters(&self) -> Value
Get the tool parameters schema (JSON Schema format).
Provided Methods§
Sourcefn validate_params(&self, params: &Value) -> Vec<String>
fn validate_params(&self, params: &Value) -> Vec<String>
Validate parameters against the schema.