> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 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**](../modules/tools) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

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.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    agent["Agent"] -- "uses" --> tool["Tool: Tool"]
    tool -- "returns" --> result["Result"]
    style tool fill:#189AB4,color:#fff
    style agent fill:#8B0000,color:#fff
    style result fill:#8B0000,color:#fff
```

## Methods

### `name`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn name(&self) -> &str
```

Get the tool name

### `description`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn description(&self) -> &str
```

Get the tool description

### `parameters_schema`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn parameters_schema(&self) -> Value
```

Get the parameter schema as JSON Schema

### `execute`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn execute(&self, args: Value) -> Result<Value>
```

Execute the tool with the given arguments

**Parameters:**

| Name   | Type    |
| ------ | ------- |
| `args` | `Value` |

### `definition`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn definition(&self) -> ToolDefinition
```

Get the tool definition for LLM function calling

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/tools/mod.rs">
  `praisonai/src/tools/mod.rs` at line 0
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Tools" icon="wrench" href="/docs/rust/tools" />

  <Card title="Rust Code Execution" icon="terminal" href="/docs/rust/code-execution" />

  <Card title="Rust Web Search" icon="search" href="/docs/rust/web-search" />
</CardGroup>
