Home/Blog/OpenAI Tool Search: Deferred Loading for AI Rollouts
AI rollout guide

OpenAI tool search: deferred loading without widening access

Configure OpenAI Responses tool search, choose hosted or client discovery, and test deferred tool loading with customer access and execution checks.

Remqa · November 30, 2026 · 5 min read

Short answer

In the OpenAI Responses API, add tool_search to the tools array and set defer_loading to true on the functions or MCP servers you want loaded on demand. Use hosted search for a known tool inventory, or client-executed search when your application controls discovery. Keep authorization in your backend because discovering a tool does not grant permission to execute it.

  • Adding tool_search alone does not defer every function
  • Namespace names and descriptions remain visible before individual tools load
  • Client search must return tool_search_output with the matching call_id
  • Discovery, authorization and business action confirmation need separate checks

A customer workflow needs one account lookup, but the agent receives the definitions for billing, recruiting, support and reporting tools before it can start. The growing catalog takes up context and makes tool selection harder to inspect. OpenAI tool search lets the model load relevant definitions when needed instead of loading every schema at the beginning.

That changes how tools reach the model. It does not replace the permission checks in your application. This guide covers the Responses API configuration and a recommended customer rollout design. Backend authorization, approval records and reconciliation controls described below are engineering recommendations, not automatic guarantees from tool search.

Enable deferred loading explicitly

In Responses, add a tool_search tool to the tools array. Mark the functions you want deferred with defer_loading set to true. For an MCP server, set defer_loading on the server tool definition. Confirm support for your chosen model before enabling the route. Do not assume every model or every API runtime shares the same configuration.

Adding tool_search does not automatically defer all functions. A function without the flag remains available immediately. For namespace groups, the flag belongs to the functions inside the namespace, not the namespace object. Review the actual request your application sends rather than relying on a configuration label in your own dashboard.

Keep a versioned inventory of tool names, descriptions and parameter definitions. Classify each by its purpose and whether it reads or changes external state. Start with the workflow that suffers from a large catalog. A small, stable set of frequently used tools may not need another discovery step.

Choose hosted or client-executed search

RouteDiscovery ownerUseful starting point
Hosted tool searchOpenAI searches the declared deferred inventoryThe candidate tools are known when constructing the request
Client-executed searchYour application looks up trusted definitionsThe inventory depends on project or customer state
Immediate loadingThe request exposes the definition at the startA small catalog or a tool needed for most tasks

For hosted search, declare the candidate functions, namespaces or MCP servers up front. The API loads the selected subset when the model searches. When that happens, the response includes tool_search_call and tool_search_output items before the eventual function call. Inspect those items when diagnosing why a workflow chose a particular tool.

Client-executed search gives your application control of the lookup. Configure tool_search with execution set to client and a schema for search arguments. The model emits a tool_search_call. Your application performs the search and returns a tool_search_output containing the selected definitions. Echo the original call_id so the result belongs to the correct request.

Do not treat the search result as the business operation's result. Returning a definition makes a function callable. A later function call still needs execution and its own result handling. Keep these steps distinct in logs and operator screens.

Write descriptions that help discovery

The model still sees searchable names and descriptions before loading details. For a namespace or MCP server, that means its high-level name and description are visible while the individual function definitions wait for discovery. An individual deferred function still exposes its name and description, so the main deferred part is its parameter schema.

Group tools by a concrete use case, such as customer account lookup or interview coordination. Describe what the group contains in plain language. Keep detailed argument rules with the functions. A vague namespace called utilities gives the model little basis for deciding whether it contains the needed action.

Do not put secrets, customer records or privileged operational notes into descriptions. Deferred loading should not be used as a confidentiality boundary. Review descriptions as information deliberately supplied to the model, even when the corresponding function has not yet been loaded.

Keep discovery separate from authorization

A loaded tool is not an access grant. Filter the searchable inventory using trusted application context, then recheck permissions when executing a function. Never use the model's selected customer identifier as the only evidence of customer scope.

For client search, accept only tool definitions from a registry you control. Validate returned schemas before including them in the response. The guide supports advanced flows that introduce tools not declared in the original request, but that flexibility makes the registry boundary important. User-provided text should not create an executable tool definition.

At execution, check the authenticated actor, customer account, resource and operation. Recheck current permissions even if discovery happened earlier. If a workflow requests a write, bind any approval to the exact resource and intended change. Our MCP approval guide covers the separate sharing and approval concerns around remote tools.

Record whether the system discovered a tool, called it, received a result and confirmed the external change. An uncertain write should enter reconciliation rather than being retried because the model failed to produce a final sentence. Tool discovery does not solve duplicate business actions.

Preserve the conversation and measure the full task

The Responses guide places newly loaded tools at the end of the model context to preserve its cache. In client mode, tools listed in tool_search_output.tools become available for future turns. Your conversation handling must retain the relevant output items rather than rebuilding history from only the visible final answer.

Changing the loaded tool set can break the cache from that point onward. Treat tool-definition versions as part of a release, not an invisible background edit. Measure input-token usage and total task latency on representative requests. Include discovery, empty searches, incorrect selections and execution failures. The vendor describes possible savings, not a guaranteed improvement for every catalog.

Test failure paths before customer rollout

  1. Run a task that needs a deferred function and confirm it is discovered before use.
  2. Use an ambiguous request and check that the selected tool matches the intended operation.
  3. Search for an unavailable tool and require a clear limitation instead of an invented result.
  4. Attempt a resource lookup outside the authorized customer and verify backend denial.
  5. Change a permission after discovery and confirm execution checks it again.
  6. Interrupt a write after execution and verify reconciliation prevents a duplicate action.

Save the request, catalog version, loaded tools and confirmed application state for each test. Keep customer data out of broadly shared debugging exports. Compare the new route with the existing implementation on the same cases. Do not release solely because the response contains valid tool-search objects.

How Remqa helps with tool search rollouts

Remqa provides forward deployed engineering for customer AI workflows. A scoped implementation can cover the tool catalog, discovery route, backend checks and a release test set. Bring one workflow with its current tools and a failed run. We can use that concrete boundary to plan an implementation and handoff without assuming deferred loading alone makes the agent safe to operate.

FAQ

Questions people ask.

How do I enable OpenAI tool search in Responses?

Include tool_search in the tools array and mark the selected functions with defer_loading set to true. For an MCP server in Responses, apply that flag to the server definition. Confirm that the chosen model supports tool search.

Does defer_loading hide all information about a tool?

No. Searchable names and descriptions remain visible. For an individual deferred function, the name and description remain visible while the parameter schema is deferred. Namespace or MCP grouping can defer the detailed functions behind a higher-level description.

When should I use client-executed tool search?

Use it when discovery depends on application-controlled project or tenant state. The model emits a tool_search_call. Your application performs the lookup and returns tool_search_output with the same call_id and the selected trusted definitions.

Does loading a tool authorize the agent to use customer data?

Our recommended design treats loading as discovery only. The backend checks the authenticated actor, customer scope, resource and approved action again when a tool is executed.

Does tool search guarantee lower cost or latency?

No. The guide says it may reduce overall token usage and cost. Compare full task completion, input tokens and latency on representative requests, including the discovery step and any failed searches.

Talk to an engineer

Want an engineer to look at your setup?

Book a free 30-minute call. We look at your tools and your team's week and tell you what we would do first.

Book a free 30-minute call
30 minutesFree, with an engineer
Your stackWe look at what you run today
Straight answerIncluding when we're not the fit