{"record":{"id":"2c095c9738e784d3","repo":"Hmbown/CodeWhale","slug":"invalid-mcp-tool-name-prefixed-name","errorCode":null,"errorMessage":"Invalid MCP tool name: {prefixed_name}","messagePattern":"Invalid MCP tool name: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/mcp.rs","lineNumber":4441,"sourceCode":"            .any(|prompt| prompt.name == prompt_name)\n        {\n            anyhow::bail!(\n                \"MCP prompt '{prompt_name}' was not advertised by server '{server_name}'\"\n            );\n        }\n        let timeout = conn.config().effective_execute_timeout(&global_timeouts);\n        conn.get_prompt(prompt_name, arguments, timeout).await\n    }\n\n    /// Parse a prefixed name into (server_name, tool_name)\n    pub(crate) fn parse_prefixed_name(&self, prefixed_name: &str) -> Result<(String, String)> {\n        Self::authorize_call(\n            &self.disallowed_tools,\n            prefixed_name,\n            &serde_json::json!({}),\n        )?;\n        let Some(rest) = prefixed_name.strip_prefix(\"mcp_\") else {\n            anyhow::bail!(\"Invalid MCP tool name: {prefixed_name}\");\n        };\n\n        let mut matched: Option<(String, String)> = None;\n        for (server, connection) in &self.connections {\n            if !self.server_allowed(server) || !connection.catalog_authorized() {\n                continue;\n            }\n            for tool in connection.tools() {\n                if !connection.config().is_tool_enabled(&tool.name)\n                    || format!(\"{server}_{}\", tool.name) != rest\n                {\n                    continue;\n                }\n                if matched.is_some() {\n                    anyhow::bail!(\n                        \"Ambiguous MCP tool name '{prefixed_name}' matches more than one server/tool authority\"\n                    );\n                }","sourceCodeStart":4423,"sourceCodeEnd":4459,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/mcp.rs#L4423-L4459","documentation":"parse_prefixed_name requires the mcp_ prefix; a tool name without it cannot identify an MCP server/tool pair and is rejected before any server resolution, so built-in tools must not be routed through this path.","triggerScenarios":"Thrown at crates/tui/src/mcp.rs:4441 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call MCP tools with their prefixed form 'mcp_<server>_<tool>' (or '<server>__<tool>' per project convention).","Check the tool name for typos; unprefixed names must strip the 'mcp_' marker."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}