tools

Macro tools 

Source
tools!() { /* proc-macro */ }
Expand description

Define multiple tools in a single component.

This macro generates the complete HTTP handler with routing for your tools. The macro automatically handles JSON serialization and HTTP routing.

This macro allows you to define all your tools in one place, automatically generating the HTTP handler and metadata for each tool.

§Example

tools! {
    /// Echo back the input message
    fn echo(input: EchoInput) -> ToolResponse {
        ToolResponse::text(format!("Echo: {}", input.message))
    }

    /// Reverse the input text
    fn reverse(input: ReverseInput) -> ToolResponse {
        ToolResponse::text(input.text.chars().rev().collect::<String>())
    }
}