pub trait Tool: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn label(&self) -> &str;
fn description(&self) -> &str;
fn parameters(&self) -> Value;
fn is_readonly(&self) -> bool;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
call_id: &'life1 str,
params: Value,
ctx: ToolContext,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn policy_metadata(&self) -> ToolMetadata { ... }
}Expand description
A tool that can be invoked by the agent.
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Description shown to the LLM.
Sourcefn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema for parameters.
Sourcefn is_readonly(&self) -> bool
fn is_readonly(&self) -> bool
Whether this tool only reads (no side effects).
Provided Methods§
Sourcefn policy_metadata(&self) -> ToolMetadata
fn policy_metadata(&self) -> ToolMetadata
Metadata used by the runtime reference monitor.