{"record":{"id":"686aeebdec55f3e1","repo":"openai/codex","slug":"method-exceeded-the-catalog-limit-of-max-items","errorCode":null,"errorMessage":"{method} exceeded the catalog limit of {max_items} items","messagePattern":"(.+?) exceeded the catalog limit of (.+?) items","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/codex-mcp/src/pagination.rs","lineNumber":55,"sourceCode":"    let collect = async {\n        let mut collected = Vec::new();\n        let mut cursor = None;\n        let mut seen_cursors = HashSet::new();\n        let mut page_count = 0;\n\n        loop {\n            if page_count == MAX_MCP_CATALOG_PAGES {\n                return Err(anyhow!(\n                    \"{method} exceeded the pagination limit of {MAX_MCP_CATALOG_PAGES} pages\"\n                ));\n            }\n            page_count += 1;\n            let params = cursor.as_ref().map(|next: &String| {\n                PaginatedRequestParams::default().with_cursor(Some(next.clone()))\n            });\n            let (items, next_cursor) = fetch(params).await?;\n            if items.len() > max_items.saturating_sub(collected.len()) {\n                return Err(anyhow!(\n                    \"{method} exceeded the catalog limit of {max_items} items\"\n                ));\n            }\n            collected.extend(items);\n\n            let Some(next_cursor) = next_cursor else {\n                return Ok(collected);\n            };\n            if next_cursor.len() > MAX_MCP_PAGINATION_CURSOR_BYTES {\n                return Err(anyhow!(\n                    \"{method} returned a pagination cursor exceeding {MAX_MCP_PAGINATION_CURSOR_BYTES} bytes\"\n                ));\n            }\n            if !seen_cursors.insert(next_cursor.clone()) {\n                return Err(anyhow!(\"{method} returned a repeated pagination cursor\"));\n            }\n            cursor = Some(next_cursor);\n        }","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/codex-mcp/src/pagination.rs#L37-L73","documentation":"Error \"{method} exceeded the catalog limit of {max_items} items\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/codex-mcp/src/pagination.rs:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Narrow the listing so the catalog stays under the item cap, or fix the MCP server to paginate correctly."],"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"}