Skip to main content

Server

Trait Server 

Source
pub trait Server {
    // Required methods
    fn info(&self) -> ServerInfo<'_>;
    fn tools(&self) -> Vec<Value>;
    fn call(&self, tool: &str, input: Input) -> Result<Output, ToolError>;
}
Expand description

What a guest serves: who it is, its tools, and how to call one.

Required Methods§

Source

fn info(&self) -> ServerInfo<'_>

Source

fn tools(&self) -> Vec<Value>

Each tool as MCP’s Tool, always in the same order.

Source

fn call(&self, tool: &str, input: Input) -> Result<Output, ToolError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§