macro_rules! declare_tool {
($name:expr, $handler:ident) => { ... };
}Expand description
Declare a WASM plugin tool with ABI v2 exports.
Generates three required exports:
az_alloc(size: i32) -> i32— allocator for host↔plugin memory sharingaz_tool_name() -> i64— packed ptr|len of the tool name stringaz_tool_execute(input_ptr: i32, input_len: i32) -> i64— main entry point
§Usage
ⓘ
use agentzero_plugin_sdk::prelude::*;
declare_tool!("my_tool", handler);
fn handler(input: ToolInput) -> ToolOutput {
ToolOutput::success("hello from plugin")
}The handler function must have signature fn(ToolInput) -> ToolOutput.