MCPAI AgentAPI EngineeringNbility

Missing MCP tools may be on the next page

Follow opaque nextCursor values, including empty strings, to discover the complete MCP catalog. Test pagination and failure handling offline.

Missing MCP tools may be on the next page

A connected MCP server can still have missing tools if its client reads only the first catalog page. tools/list supports cursor pagination. The current specification explicitly treats an empty string as a potentially valid continuation cursor, so a truthiness check can silently truncate discovery.

This guide checks MCP 2026-07-28 Pagination on November 25, 2026. Its Python example runs against local dictionaries without an SDK, server or model.

Why does a successful connection omit tools?

Connection, complete discovery, permission filtering and model exposure are separate stages.

Python SDK issue #3792, opened October 31, reports that ClientSessionGroup calls each listing method once and ignores next_cursor. The author reports reproduction on main at d7845c07. November replies discuss pagination, collisions and cycle protection. The issue remains open at the time of reading; this article does not establish a released fix or reproduce that SDK behavior.

A participant also recommends treating an empty cursor as terminal, which conflicts with the current specification. Discussion is useful evidence of an integration problem, but its proposed handling still needs checking against the applicable protocol.

A connection, full catalog, permission-filtered set and model request are distinct checks

After complete discovery, a host may intentionally expose only an allowed or retrieved subset. That is different from losing later pages. See MCP tool assignment in OpenCode for a client-specific exposure layer.

How should nextCursor be handled?

Pass any non-null nextCursor unchanged as the next request's cursor; do not decode it, increment it or infer a page size.

These are two illustrative result members, with tool entries omitted to focus on pagination:

[
  {"resultType": "complete", "tools": [], "nextCursor": "", "ttlMs": 0, "cacheScope": "private"},
  {"resultType": "complete", "tools": [], "ttlMs": 0, "cacheScope": "private"}
]

The first page is empty but still continues. Stop normally when no non-null continuation cursor is supplied, not when a page is short or empty. if not cursor incorrectly treats "" as an end marker.

Pagination applies to tools/list, prompts/list, resources/list and resources/templates/list. An SDK may expose the wire field nextCursor as next_cursor; keep these layers distinct.

Can the traversal be checked without a server?

Save the following as catalog_demo.py in a temporary directory and run it with Python 3.

pages = {
    None: {"tools": [{"name": "first"}], "nextCursor": ""},
    "": {"tools": [], "nextCursor": "page-3"},
    "page-3": {"tools": [{"name": "last"}]},
}


def collect(fetch_page, max_pages=20):
    cursor = None
    visited = set()
    tools = []
    names = set()
    for _ in range(max_pages):
        page = fetch_page(cursor)
        for tool in page["tools"]:
            name = tool["name"]
            if name in names:
                raise ValueError("duplicate tool name")
            names.add(name)
            tools.append(tool)
        next_cursor = page.get("nextCursor")
        if next_cursor is None:
            return tools
        if not isinstance(next_cursor, str):
            raise ValueError("cursor must be a string")
        if next_cursor in visited:
            raise ValueError("cursor cycle")
        visited.add(next_cursor)
        cursor = next_cursor
    raise ValueError("page budget exceeded")


catalog = collect(pages.__getitem__)
print([tool["name"] for tool in catalog])

The expected output is ['first', 'last']. An empty middle page deliberately tests that emptiness does not terminate traversal. Entries contain names only for this exercise; real discovery must preserve and validate complete tool definitions.

An empty middle page still continues through an opaque cursor

Make the final page return a previously seen cursor to exercise cursor cycle. Rename its tool to first to trigger the duplicate-name check. The 20-page budget is an application choice, not an MCP limit. Production callers also need per-page timeouts, a total discovery deadline and appropriate catalog-size bounds.

What if a later page fails?

A host can choose an explicit degraded mode, but it should not present a partial catalog as complete discovery.

collect returns only after normal completion, allowing the caller to replace the published catalog after all pages succeed. A later-page timeout, invalid response or cycle should leave discovery visibly incomplete. If an older snapshot remains visible, identify it as stale and keep current authorization checks; cached entries must not restore revoked access.

Names should be unique within a server. Cross-server aggregation needs a stable configured identity to disambiguate names; a server's self-reported name is not guaranteed unique. Keep ordering stable when practical without renaming the underlying tools.

Stage and validate pages before publishing the catalog; failures remain explicit

The current protocol also uses resultType and cache fields, and requests require version/capability metadata. The dictionary exercise verifies pagination logic only, not a full MCP implementation.

Where should a missing tool be traced?

Compare the server's complete raw catalog with the host's catalog, then inspect the tools actually exposed to the current agent.

No second request points to pagination. Name collisions point to aggregation. An intentional subset points to permission or retrieval policy. A model rejecting an exposed definition calls for tool Schema troubleshooting. The same pagination rules apply to resources and Prompts.

Record versions, page counts, cursor presence and the failure stage. Avoid publishing real cursor values, which may reveal internal information. The local traversal and failure cases were executed; no SDK release fix or real model tool-selection behavior was verified.

Related posts

Validate an MCP tool result beyond its JSON
MCPAI AgentAPI Engineering

Validate an MCP tool result beyond its JSON

Distinguish content, structuredContent, outputSchema and isError before treating an MCP tool response as a successful business result.

Run your Agent workflow through Nbility

Get an API key and connect OpenAI-compatible models and developer tools from one place.

Get an API key