Tool • Rust AI Agent SDK
Tool: 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…
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) -> &strGet the tool name
description
fn description(&self) -> &strGet the tool description
parameters_schema
fn parameters_schema(&self) -> ValueGet the parameter schema as JSON Schema
execute
async fn execute(&self, args: Value) -> Result<Value>Execute the tool with the given arguments
Parameters:
| Name | Type |
|---|---|
args | Value |
definition
fn definition(&self) -> ToolDefinitionGet the tool definition for LLM function calling
Source
View on GitHubpraisonai/src/tools/mod.rs at line 0