Tools
An MCP server that keeps handing out fresh cursors could make the Agents SDK page forever
openai-agents-python PR #5133 (merged 2026-09-21) adds an optional `max_list_pages` setting to stdio, SSE and Streamable HTTP MCP servers. Without it, automatic tool and prompt listing keeps fetching successful pages indefinitely when a server returns fresh continuation cursors — and that happens during tool discovery, before the model runs at all. A positive limit bounds successful pages per listing call; exceeding it raises an actionable `UserError` without returning or caching partial results and without exposing cursor or response data, and the budget survives failed-page retries. `None` keeps the existing unlimited default, so this is opt-in hardening you have to actually set.
Source
↳ Follow the thread