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.

Diagram

uses

returns

Agent

Tool: Tool

Result

Methods

name

rust
fn name(&self) -> &str

Get the tool name

description

rust
fn description(&self) -> &str

Get the tool description

parameters_schema

rust
fn parameters_schema(&self) -> Value

Get the parameter schema as JSON Schema

execute

rust
async fn execute(&self, args: Value) -> Result<Value>

Execute the tool with the given arguments

Parameters:

NameType
argsValue

definition

rust
fn definition(&self) -> ToolDefinition

Get the tool definition for LLM function calling

Source

View on GitHub

praisonai/src/tools/mod.rs at line 0


Related Documentation