Macro ftl_mcp_server

Source
macro_rules! ftl_mcp_server {
    ($tool:expr) => { ... };
}
Expand description

Macro to create the main entry point for a tool server

Example:

use ftl_core::prelude::*;

#[derive(Clone)]
struct MyTool;

impl Tool for MyTool {
    fn name(&self) -> &'static str {
        "my-tool"
    }
    fn description(&self) -> &'static str {
        "Example tool"
    }
    fn input_schema(&self) -> serde_json::Value {
        serde_json::json!({})
    }
    fn call(&self, _args: &serde_json::Value) -> Result<ToolResult, ToolError> {
        Ok(ToolResult::text("Hello".to_string()))
    }
}

// Then use the macro:
// ftl_mcp_server!(MyTool);