Skip to main content

dispatch_request

Function dispatch_request 

Source
pub async fn dispatch_request(
    request: &JsonRpcRequest,
    client: &mut McpClient,
) -> Option<JsonRpcResponse>
Expand description

Dispatch a JSON-RPC request to the appropriate handler.

Supports the MCP methods needed for tool proxy:

  • initialize / notifications/initialized
  • tools/list / tools/call
  • resources/list / resources/read
  • prompts/list / prompts/get

Returns a JSON-RPC response. Notifications (no id) return None.