Skip to main content

register_mcp_tool

Macro register_mcp_tool 

Source
macro_rules! register_mcp_tool {
    (name: $name:expr, definition: $def:path, dispatch: $dispatch:path $(,)?) => { ... };
}
Expand description

Submit one McpToolEntry to the global inventory.

Usage (one invocation per tools/<tool>.rs):

register_mcp_tool!(
    name: "apr.foo",
    definition: foo_tool_definition,
    dispatch: dispatch,
);

The dispatch argument MUST point at a function with signature DispatchFn — typically a thin shim that calls the tool’s existing call / call_with_sink.