Why OpenAI Codex Enables Tool Search by Default for Better Efficiency

Why OpenAI Codex Enables Tool Search by Default
Codex now activates tool search automatically. This happens for supported models. The shift replaces static schema injection with dynamic discovery. The system retrieves tools only when the agent identifies a specific need.
A fundamental shift has occurred. Previously, developers relied on feature flags. They accepted the performance penalty of loading every tool. The recent merge of PR #17854 promoted ToolSearch to stable status. This update ensures the searched-tool flow is standard. You no longer need complex toggles. Accessing this efficiency is now automatic.
The shift from static to dynamic
Context management is the core distinction. In the legacy approach, Codex received the full Model Context Protocol (MCP) schema. This happened at the start of every session. The method caused significant context pollution. Irrelevant tool definitions occupied valuable space. The model processed this noise unnecessarily.
Dynamic search alters this workflow. The agent begins with a clean slate. It analyzes the user request first. If external action is necessary, it triggers a semantic search. This process queries the tool registry. The system injects only relevant definitions. This targeted approach preserves model attention.
This architecture aligns with Codex design goals. The agent, written primarily in Rust, prioritizes speed. We reduce initial latency by removing upfront schema loading costs. The agent acts like a skilled developer. It consults documentation only when needed. It does not memorize every library function. This on-demand retrieval supports better token optimization. Developers connect numerous MCP servers without fear. The system scales gracefully. Your tool ecosystem grows without issue.
OpenAI removed the full tool list. This eliminates pollution and reduces token waste. Agents process only relevant definitions. This leads to significant cost savings. Response times improve noticeably.
Reducing context pollution
The Model Context Protocol (MCP) connects AI applications efficiently Source: modelcontextprotocol.io. This standardization offers clear benefits. Yet it introduces a challenge. Servers expose hundreds of tools. Injecting every definition creates substantial noise. The model parses irrelevant schemas. This distracts from the primary task. Context pollution degrades reasoning quality.
Before recent updates, MCP tools used tool search conditionally. This occurred only if a feature flag was enabled. Or if there were at least 100 tools Source: github.com. This threshold approach was insufficient. Developers faced latency spikes. The context window filled with unused signatures. OpenAI removed the full list. The agent now focuses on immediate intent. It does not scan a massive registry. The searched-tool flow is now intended behavior Source: github.com. Uniformity prevents accuracy degradation.
Improving token efficiency
Token optimization manages operational costs.
Frequently Asked Questions
Does enabling tool search by default increase latency?
How many tools does Codex retrieve per search query?
Is tool search compatible with custom MCP servers?
What happens if tool search fails to find a relevant tool?
Do I need to update my Codex configuration to use tool search?
Nicola
Developer and creator of vexp — a context engine for AI coding agents. I build tools that make AI coding assistants faster, cheaper, and actually useful on real codebases.
Keep reading
Related articles

Claude Code Max Subagents Per Session 200: Complete Management Guide
Learn to manage Claude Code max subagents per session 200 limit. Master subagent budget, parallel agents, context window, and cost control for efficient AI coding.

GitHub Models Retirement: July 30 Migration Guide for Developers
GitHub Models retires July 30, 2026. Learn key dates, brownout periods, and how to migrate your inference API to Azure AI Foundry or alternatives.

Claude Code OpenTelemetry Metrics Setup: Complete Guide 2026
Learn how to set up OpenTelemetry metrics for Claude Code in 2026. Configure OTLP exporter, enable LLM observability, and track token usage with this step-by-step