pub trait McpNamespace {
// Required methods
fn mcp_namespace_tools() -> Vec<Value>;
fn mcp_namespace_tool_names() -> Vec<String>;
fn mcp_namespace_call(
&self,
name: &str,
args: Value,
) -> Result<Value, String>;
fn mcp_namespace_call_async(
&self,
name: &str,
args: Value,
) -> impl Future<Output = Result<Value, String>> + Send;
}Expand description
Trait for types that can be mounted as MCP tool namespaces.
Implemented automatically by #[mcp] on an impl block. Allows nested
composition: a parent MCP server can mount a child’s tools with a name prefix.
Required Methods§
Sourcefn mcp_namespace_tools() -> Vec<Value>
fn mcp_namespace_tools() -> Vec<Value>
Get tool definitions for this namespace.
Sourcefn mcp_namespace_tool_names() -> Vec<String>
fn mcp_namespace_tool_names() -> Vec<String>
Get tool names for this namespace (without prefix).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.