Skip to main content

execute

Function execute 

Source
pub async fn execute(
    provider: &Provider,
    tool_name: &str,
    args: &HashMap<String, Value>,
    keyring: &Keyring,
) -> Result<Value, McpError>
Expand description

Execute an MCP tool call — high-level entry point for cli/call.rs dispatch.

  1. Connects to the MCP server (or reuses connection via cache — future optimization)
  2. Strips the provider prefix from the tool name (e.g., “github:read_file” → “read_file”)
  3. Calls tools/call with the raw MCP tool name
  4. Returns the result as a serde_json::Value