{"record":{"id":"2ba5a0bef99a2264","repo":"Hmbown/CodeWhale","slug":"mcp-tool-tool-name-is-disabled-for-server-se","errorCode":null,"errorMessage":"MCP tool '{tool_name}' is disabled for server '{server_name}'","messagePattern":"MCP tool '(.+?)' is disabled for server '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":4929,"sourceCode":"        };\n        let server_name = route.server_name.clone();\n        let tool_name = route.tool_name.clone();\n        // Copy the global timeouts to avoid borrow conflict\n        let global_timeouts = self.config.timeouts;\n        let conn = self.get_or_connect(&server_name).await?;\n        if conn.catalog_generation != route.catalog_generation {\n            anyhow::bail!(\"MCP catalog changed after tool resolution; retry the call\");\n        }\n        if conn\n            .config()\n            .reviewed_plugin\n            .as_ref()\n            .map(|source| &source.authority)\n            != route.plugin_authority.as_ref()\n            || !conn.config().is_tool_enabled(&tool_name)\n            || !conn.tools().iter().any(|tool| tool.name == tool_name)\n        {\n            anyhow::bail!(\"MCP tool '{tool_name}' is disabled for server '{server_name}'\");\n        }\n        let timeout = conn.config().effective_execute_timeout(&global_timeouts);\n        let result = match conn.call_tool(&tool_name, arguments.clone(), timeout).await {\n            Ok(result) => Ok(result),\n            // A rejected credential is not a stale session: reconnecting\n            // replays the same rejection, so it takes the auth-required\n            // path below instead of the transparent retry.\n            Err(err)\n                if is_retriable_mcp_call_error(&err) && !oauth::error_looks_auth_required(&err) =>\n            {\n                tracing::debug!(\n                    target: \"mcp\",\n                    server = server_name,\n                    tool = tool_name,\n                    error = %err,\n                    \"retrying MCP tool call after stale session\"\n                );\n                self.drop_connection(&server_name, \"stale session retry\");","sourceCodeStart":4911,"sourceCodeEnd":4947,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp.rs#L4911-L4947","documentation":"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.","triggerScenarios":"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().","commonSituations":"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).","solutions":["Re-enable the tool in the MCP server config (enable_tools / tool allowlist) and retry","Re-resolve the route so plugin_authority matches the currently reviewed plugin","Verify the tool name against the server's current tool list; update the route if the tool was renamed or removed"],"exampleFix":"// before\nroute.tool_name = \"files_write\"; // renamed upstream\n// after\nlet tools = conn.list_tools().await?;\nlet name = tools.iter().find(|t| t.name.contains(\"write\")).map(|t| t.name.clone())?;\nroute.tool_name = name;","handlingStrategy":"validation","validationCode":"let conn = get_or_connect(&server_name).await?;\nif !conn.config().is_tool_enabled(&tool_name)\n    || !conn.tools().iter().any(|t| t.name == tool_name) {\n    return Err(format!(\"tool {tool_name} unavailable/disabled on {server_name}\"));\n}","typeGuard":"fn tool_available(conn: &Connection, name: &str) -> bool {\n    conn.config().is_tool_enabled(name)\n        && conn.tools().iter().any(|t| t.name == name)\n}","tryCatchPattern":null,"preventionTips":["Check is_tool_enabled and the live tool list before building a route","Keep the reviewed-plugin authority in sync when editing MCP config","Log config changes to tools so disabled tools are noticed before calls fail"],"tags":["mcp","tool-disabled","config"],"backgroundTag":"feature-not-enabled","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}