Skip to main content

tool

Defined in the Derive Macros module.
Rust AI Agent SDK
fn tool(attr: TokenStream, item: TokenStream) -> TokenStream
The #[tool] attribute macro for defining tools. This macro transforms a function into a tool that can be used by agents. # Attributes - description: A description of what the tool does (required for LLM understanding) - name: Override the tool name (defaults to function name)

Parameters

NameTypeDescription
attrTokenStream-
itemTokenStream-