pub trait ToolDefinitionLike: Send + Sync {
// Required methods
fn tool_name(&self) -> &str;
fn tool_label(&self) -> &str;
fn tool_description(&self) -> &str;
fn tool_parameters(&self) -> Value;
fn tool_execute(
&self,
tool_call_id: &str,
params: Value,
signal: Option<Receiver<()>>,
) -> Pin<Box<dyn Future<Output = Result<AgentToolResult, ToolError>> + Send>>;
}Expand description
Trait for tool definitions that can be wrapped into AgentTool.
Required Methods§
Sourcefn tool_label(&self) -> &str
fn tool_label(&self) -> &str
Returns a human-readable label for UI display.
Sourcefn tool_description(&self) -> &str
fn tool_description(&self) -> &str
Returns the tool description sent to the LLM.
Sourcefn tool_parameters(&self) -> Value
fn tool_parameters(&self) -> Value
Returns the JSON schema for the tool’s parameters.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".