Hmbown/CodeWhale · error

MCP tool ' ' is disabled for server

Error message

MCP tool '{tool_name}' is disabled for server '{server_name}'

What it means

The resolved tool route failed a policy check before execution: the tool is disabled in the server's config, the plugin authority no longer matches, or the tool is absent from the connection's current tool list. The library refuses to invoke tools that configuration or the live catalog no longer permits.

Solutions

  1. Re-enable the tool in the MCP server config (enable_tools / tool allowlist) and retry
  2. Re-resolve the route so plugin_authority matches the currently reviewed plugin
  3. Verify the tool name against the server's current tool list; update the route if the tool was renamed or removed

Example fix

// before
route.tool_name = "files_write"; // renamed upstream
// after
let tools = conn.list_tools().await?;
let name = tools.iter().find(|t| t.name.contains("write")).map(|t| t.name.clone())?;
route.tool_name = name;
Defensive patterns

Strategy: validation

Validate before calling

let conn = get_or_connect(&server_name).await?;
if !conn.config().is_tool_enabled(&tool_name)
    || !conn.tools().iter().any(|t| t.name == tool_name) {
    return Err(format!("tool {tool_name} unavailable/disabled on {server_name}"));
}

Type guard

fn tool_available(conn: &Connection, name: &str) -> bool {
    conn.config().is_tool_enabled(name)
        && conn.tools().iter().any(|t| t.name == name)
}

Prevention

When it happens

Trigger: Calling call_tool/route execution when conn.config().is_tool_enabled(tool_name) is false, the reviewed plugin authority differs from route.plugin_authority, or the tool no longer appears in conn.tools().

Common situations: A user disabled the tool in MCP server config after the route was resolved; the server removed or renamed the tool; the reviewed-plugin authority changed (e.g. config edited or a different reviewed source was approved).

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/2ba5a0bef99a2264. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/mcp.rs:4929

        };
        let server_name = route.server_name.clone();
        let tool_name = route.tool_name.clone();
        // Copy the global timeouts to avoid borrow conflict
        let global_timeouts = self.config.timeouts;
        let conn = self.get_or_connect(&server_name).await?;
        if conn.catalog_generation != route.catalog_generation {
            anyhow::bail!("MCP catalog changed after tool resolution; retry the call");
        }
        if conn
            .config()
            .reviewed_plugin
            .as_ref()
            .map(|source| &source.authority)
            != route.plugin_authority.as_ref()
            || !conn.config().is_tool_enabled(&tool_name)
            || !conn.tools().iter().any(|tool| tool.name == tool_name)
        {
            anyhow::bail!("MCP tool '{tool_name}' is disabled for server '{server_name}'");
        }
        let timeout = conn.config().effective_execute_timeout(&global_timeouts);
        let result = match conn.call_tool(&tool_name, arguments.clone(), timeout).await {
            Ok(result) => Ok(result),
            // A rejected credential is not a stale session: reconnecting
            // replays the same rejection, so it takes the auth-required
            // path below instead of the transparent retry.
            Err(err)
                if is_retriable_mcp_call_error(&err) && !oauth::error_looks_auth_required(&err) =>
            {
                tracing::debug!(
                    target: "mcp",
                    server = server_name,
                    tool = tool_name,
                    error = %err,
                    "retrying MCP tool call after stale session"
                );
                self.drop_connection(&server_name, "stale session retry");

View on GitHub (pinned to 73e0f67d83)