Extend GPT-5.4-style tool search and deferred loading to all MCP server tools to save tokens (-47 %)

Resolved 💬 2 comments Opened Mar 12, 2026 by wbdb Closed Aug 5, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

Windows App, CLI - 0.114.0 (both with WSL2)

What feature would you like to see?

Eextend GPT-5.4-style tool search and deferred loading to all MCP server tools, not just app/connector-backed tools - https://developers.openai.com/api/docs/guides/tools-tool-search/.

Right now, general MCP tools still appear to be injected into the model context up front, which can consume a large number of tokens in tool-heavy setups.

It would be valuable to support an optional or automatic mode that routes all MCP tools through the new tool_search (announced here https://openai.com/index/introducing-gpt-5-4/) for GPT-5.4 + newer models, especially when many servers or large tool schemas are configured. This could reduce token usage, improve latency, and preserve prompt cache efficiency without changing the existing MCP tool surface.

Additional information

Example of Context7 MCP tool descriptions:

  • resolve-library-id: 2000 characters, 306 words
  • query-docs: 522 characters, 82 words
  • Total: 2522 characters or 388 words

These are added to the context with every request, even though they may only be relevant for 1/20 of all requests.

View original on GitHub ↗

2 Comments

tspython · 4 months ago

Important to fix as this would really bring open ai agents sdk up to par with other agent sdks.

etraut-openai contributor · 23 days ago

Lazy MCP discovery is implemented through tool_search.