Skip to main content

Tool

Defined in the Tools module.
Rust AI Agent SDK Trait for tools that can be used by agents This trait defines the interface for tools. Tools can be created using the #[tool] macro or by implementing this trait directly.

Methods

name

fn name(&self) -> &str
Get the tool name

description

fn description(&self) -> &str
Get the tool description

parameters_schema

fn parameters_schema(&self) -> Value
Get the parameter schema as JSON Schema

execute

async fn execute(&self, args: Value) -> Result<Value>
Execute the tool with the given arguments Parameters:
NameType
argsValue

definition

fn definition(&self) -> ToolDefinition
Get the tool definition for LLM function calling