{"record":{"id":"90962c3cc8ab9913","repo":"openai/codex","slug":"tool-call-rejected-because-the-catalog-changed-aft","errorCode":null,"errorMessage":"tool call rejected because the catalog changed after `{}/{tool_name}` was prepared","messagePattern":"tool call rejected because the catalog changed after `(.+?)/(.+?)` was prepared","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/codex-mcp/src/binding.rs","lineNumber":295,"sourceCode":"    pub async fn call_with_preparation<F, Fut>(\n        &self,\n        requested_timeout: Option<Duration>,\n        prepare: F,\n    ) -> Result<CallToolResult>\n    where\n        F: FnOnce() -> Fut,\n        Fut: Future<Output = Result<(Option<JsonValue>, Option<JsonValue>)>>,\n    {\n        let effective_timeout = match (self.client.tool_timeout, requested_timeout) {\n            (Some(server_timeout), Some(requested_timeout)) => {\n                Some(server_timeout.min(requested_timeout))\n            }\n            (server_timeout, requested_timeout) => server_timeout.or(requested_timeout),\n        };\n        let tool_name = self.tool_info.tool.name.to_string();\n        let current_revision = self.catalog_revision_source.read().await;\n        if *current_revision != self.catalog_revision {\n            return Err(anyhow::anyhow!(\n                \"tool call rejected because the catalog changed after `{}/{tool_name}` was prepared\",\n                self.server_name\n            ));\n        }\n        let (arguments, meta) = prepare().await?;\n        let result = self\n            .client\n            .client\n            .call_tool(tool_name.clone(), arguments, meta, effective_timeout)\n            .await\n            .with_context(|| format!(\"tool call failed for `{}/{tool_name}`\", self.server_name))?;\n        drop(current_revision);\n        Ok(call_tool_result_from_rmcp(result))\n    }\n}\n\npub(crate) fn call_tool_result_from_rmcp(result: rmcp::model::CallToolResult) -> CallToolResult {\n    let content = result","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/codex-mcp/src/binding.rs#L277-L313","documentation":"Error \"tool call rejected because the catalog changed after `{}/{tool_name}` was prepared\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/codex-mcp/src/binding.rs:295 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}