macro_rules! impl_mcp_tool {
(
name = $tool_name:expr,
description = $tool_desc:expr,
struct $struct_name:ident {
$(
$field:ident: $field_type:ty {
description = $field_desc:expr
$(, min_length = $min_len:expr)?
}
),* $(,)?
}
) => { ... };
}
Expand description
The macro generates:
impl McpToolDefinition for StructName
tool_definition()
method returningrust_mcp_sdk::schema::Tool
from_mcp_params()
method with parameter conversion and validation