Skip to main content

Crate appam_macros

Crate appam_macros 

Source
Expand description

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
  • Schema derive 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![])
}

Attribute Macros§

tool
Attribute macro for defining Appam tools from ordinary Rust functions.

Derive Macros§

Schema
Derive macro for generating JSON schemas with simplified description attributes.