Procedural macros supporting Appam's Rust-first tool authoring workflow.
The two user-facing surfaces are:
- [
tool] for turning ordinary Rust functions into runtime tools Schemaderive for generating JSON Schema from typed inputs
These macros are designed to keep tool definitions close to normal Rust code while still producing the provider-facing schema and runtime glue that Appam needs.
Examples
use appam_macros::tool;
#[tool(description = "Echoes back the input message")]
fn echo(
#[arg(description = "Message to echo")]
message: String,
) -> anyhow::Result<String> {
Ok(message)
}
// With optional parameters
#[tool(description = "Search with options")]
fn search(
#[arg(description = "Search query")]
query: String,
#[arg(description = "Max results", default = 10)]
max_results: u32,
) -> anyhow::Result<Vec<String>> {
// Implementation
Ok(vec![])
}