openai/codex · error
originating MCP tool call does not match the requested resou
Error message
originating MCP tool call does not match the requested resource
What it means
Error "originating MCP tool call does not match the requested resource" thrown in openai/codex.
Source
Thrown at codex-rs/codex-mcp/src/resource_origin.rs:255
impl ResourceOrigin {
fn byte_len(&self) -> usize {
self.call_id.len()
+ self.turn_id.as_ref().map_or(0, String::len)
+ self.tool.len()
+ self.connector_id.len()
+ self.link_id.as_ref().map_or(0, String::len)
+ self.uri.len()
}
pub(crate) async fn read(
&self,
binding: &McpBinding,
thread_id: ThreadId,
uri: &str,
) -> anyhow::Result<ReadResourceResult> {
if self.uri != uri {
anyhow::bail!("originating MCP tool call does not match the requested resource");
}
if self.ambiguous_account {
anyhow::bail!("originating MCP tool call has ambiguous account selection");
}
let tool_info = binding
.tool_info(CODEX_APPS_MCP_SERVER_NAME, &self.tool)
.context("originating MCP tool is unavailable")?;
if tool_info.connector_id.as_deref() != Some(self.connector_id.as_str()) {
anyhow::bail!("originating MCP tool connector does not match its app context");
}
let tool_meta = tool_info.tool.meta.as_ref().map(|meta| &meta.0);
let current_link_id = tool_meta
.and_then(|meta| meta.get("link_id"))
.and_then(serde_json::Value::as_str)
.filter(|value| !value.trim().is_empty());
if current_link_id != self.link_id.as_deref() {
anyhow::bail!("originating MCP tool link does not match its app context");View on GitHub (pinned to 339751715c)
Solutions
- Access the resource through the same MCP tool call that originated it.
When it happens
Trigger: Thrown at codex-rs/codex-mcp/src/resource_origin.rs:255 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/5c683015e49bb173.
Report an issue: GitHub.