Attribute Macro tool

Source
#[tool]
Expand description

Converts a Rust function into an AI agent tool with automatic schema generation.

ยงExamples

use agents_macros::tool;

#[tool("Greets a person by name")]
fn greet(name: String) -> String {
    format!("Hello, {}!", name)
}

#[tool("Searches the web for information")]
async fn web_search(query: String, max_results: Option<u32>) -> Vec<String> {
    // Implementation
    vec![]
}