{"record":{"id":"971fa0c5e566db76","repo":"openai/codex","slug":"originating-mcp-tool-call-has-ambiguous-account-se","errorCode":null,"errorMessage":"originating MCP tool call has ambiguous account selection","messagePattern":"originating MCP tool call has ambiguous account selection","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/codex-mcp/src/resource_origin.rs","lineNumber":258,"sourceCode":"        self.call_id.len()\n            + self.turn_id.as_ref().map_or(0, String::len)\n            + self.tool.len()\n            + self.connector_id.len()\n            + self.link_id.as_ref().map_or(0, String::len)\n            + self.uri.len()\n    }\n\n    pub(crate) async fn read(\n        &self,\n        binding: &McpBinding,\n        thread_id: ThreadId,\n        uri: &str,\n    ) -> anyhow::Result<ReadResourceResult> {\n        if self.uri != uri {\n            anyhow::bail!(\"originating MCP tool call does not match the requested resource\");\n        }\n        if self.ambiguous_account {\n            anyhow::bail!(\"originating MCP tool call has ambiguous account selection\");\n        }\n\n        let tool_info = binding\n            .tool_info(CODEX_APPS_MCP_SERVER_NAME, &self.tool)\n            .context(\"originating MCP tool is unavailable\")?;\n        if tool_info.connector_id.as_deref() != Some(self.connector_id.as_str()) {\n            anyhow::bail!(\"originating MCP tool connector does not match its app context\");\n        }\n        let tool_meta = tool_info.tool.meta.as_ref().map(|meta| &meta.0);\n        let current_link_id = tool_meta\n            .and_then(|meta| meta.get(\"link_id\"))\n            .and_then(serde_json::Value::as_str)\n            .filter(|value| !value.trim().is_empty());\n        if current_link_id != self.link_id.as_deref() {\n            anyhow::bail!(\"originating MCP tool link does not match its app context\");\n        }\n        if self.link_id.is_none()\n            && tool_meta","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/codex-mcp/src/resource_origin.rs#L240-L276","documentation":"Error \"originating MCP tool call has ambiguous account selection\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/codex-mcp/src/resource_origin.rs:258 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Specify an explicit account link for the tool call so the account selection is unambiguous."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}