Skip to main content

tool

Attribute Macro tool 

Source
#[tool]
Expand description

Turns a fn into a tool value: #[tool] async fn add(a: i64, b: i64) makes add a unit struct implementing Tool; the doc comment is the description, the arguments the schema, and the body stays callable as add::invoke(..). An imported add turns a let add binding into a unit-struct pattern: rename the binding or use the tool by path. Keys: name, description, crate.