openai/codex · error

exceeded the catalog limit of items

Error message

{method} exceeded the catalog limit of {max_items} items

What it means

Safety cap in collect_paginated_with_limit: the fetched items would push the total catalog past max_items, so the server's catalog is larger than allowed and collection is aborted rather than truncated silently.

Solutions

  1. Narrow the listing so the catalog stays under the item cap, or fix the MCP server to paginate correctly.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/codex-mcp/src/pagination.rs:55 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/686aeebdec55f3e1. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/codex-mcp/src/pagination.rs:55

    let collect = async {
        let mut collected = Vec::new();
        let mut cursor = None;
        let mut seen_cursors = HashSet::new();
        let mut page_count = 0;

        loop {
            if page_count == MAX_MCP_CATALOG_PAGES {
                return Err(anyhow!(
                    "{method} exceeded the pagination limit of {MAX_MCP_CATALOG_PAGES} pages"
                ));
            }
            page_count += 1;
            let params = cursor.as_ref().map(|next: &String| {
                PaginatedRequestParams::default().with_cursor(Some(next.clone()))
            });
            let (items, next_cursor) = fetch(params).await?;
            if items.len() > max_items.saturating_sub(collected.len()) {
                return Err(anyhow!(
                    "{method} exceeded the catalog limit of {max_items} items"
                ));
            }
            collected.extend(items);

            let Some(next_cursor) = next_cursor else {
                return Ok(collected);
            };
            if next_cursor.len() > MAX_MCP_PAGINATION_CURSOR_BYTES {
                return Err(anyhow!(
                    "{method} returned a pagination cursor exceeding {MAX_MCP_PAGINATION_CURSOR_BYTES} bytes"
                ));
            }
            if !seen_cursors.insert(next_cursor.clone()) {
                return Err(anyhow!("{method} returned a repeated pagination cursor"));
            }
            cursor = Some(next_cursor);
        }

View on GitHub (pinned to 339751715c)