CommandHandler

Trait CommandHandler 

Source
pub trait CommandHandler: Send + Sync {
    // Required methods
    fn handle(
        &self,
        params: Option<&Value>,
        id: Option<&Value>,
    ) -> HandlerResult;
    fn name(&self) -> &'static str;
}
Expand description

Trait for handling MCP protocol commands

Required Methods§

Source

fn handle(&self, params: Option<&Value>, id: Option<&Value>) -> HandlerResult

Handle a command with the given parameters Returns a result containing either a successful response value or an error, along with any state changes that should be applied

Source

fn name(&self) -> &'static str

Get the name of this command handler

Implementors§