TOOLS 7 min read

Interactions API Can Defer Tool Schemas—Which Ones Earn a Spot Up Front?

Google’s Tool Retrieval preview loads function schemas on demand. The test for agent builders is whether smaller prompts still deliver the right calls.

By EgoistAI ·
Interactions API Can Defer Tool Schemas—Which Ones Earn a Spot Up Front?

Google put Tool Retrieval into preview in the Gemini Interactions API on November 19, giving an agent a way to load a function’s parameter schema only when it needs it. Teams that currently put the whole toolbox in every prompt can now test a leaner first request against a less obvious cost: each server-side search triggers another model pass. Google’s announcement · Tool Retrieval guide

The tool list stays. The parameter schemas wait.

With server-side retrieval, developers still declare the functions up front. Add tool_search to the request and set defer_loading: true on the functions whose parameter schemas can wait. Gemini gets a compact catalog of those deferred functions: their names and short descriptions, or the first sentence of the regular description when no short description is supplied. When Gemini selects a deferred function, the API loads its schema and gives the model the argument definitions it needs to form the call. The preview runs on the Interactions API’s v1beta endpoint with Gemini 3.6 and later, including the Gemini 4 family. Tool Retrieval guide · Gemini API release notes

Take a support agent with separate functions to look up an order, check whether an item can be returned, and create a return label. A customer asking whether a package shipped needs the lookup. The return functions can stay discoverable without bringing along their argument lists. The split also puts more weight on the catalog entry. If the short descriptions for eligibility checks and label creation both say “handles returns,” the model has little to work with when it decides which schema to fetch. A first sentence that says “Checks whether an item qualifies for return” gives it a concrete basis for that choice.

Google’s example shows search and the resulting function call in the interaction’s steps. That gives a team a way to trace a bad outcome to a specific decision. Did the model skip search entirely? Did it retrieve the wrong function? Did it find the right one and fill in the wrong arguments? With a custom function, the application still executes the call and sends back the result, so a downstream service failure belongs in the trace too. Each failure points to a different fix. Google’s announcement · Function calling guide

One API request can contain two model passes

Google charges standard token rates with no separate Tool Retrieval fee. The first model pass includes the deferred catalog and the instructions for using search. When a server-side search runs, the API makes another model call within the same request, processing the conversation context again along with the retrieved schemas. Google reports the prompt tokens for those internal passes in total_tool_use_tokens. A team that looks only at total_input_tokens can see a tidy reduction while missing much of the bill. Loaded schemas also continue to count as input on subsequent calls and turns that carry them forward. Tool Retrieval guide

Imagine two requests to that support agent. A fresh delivery-status question might need just one compact lookup function. A long conversation about an exchange could already contain order details, earlier tool results, and several customer messages before it needs a return tool. The same search can carry more context through the second pass in the exchange. Caching can soften that cost when enough of the prefix is reusable. Deferring the full schemas can also shrink a formerly cacheable prefix below the model’s minimum. Look at the cached-token count alongside the search tokens before attributing a billing change to retrieval. Tool Retrieval guide

Keep the obvious first call available

The first candidate to load up front is a function that sits on the critical path for a large share of your traffic. If almost every order-related request starts with an order lookup, deferring that schema can force the agent to search for the same thing over and over. Look at when the function is needed as well as how often. A label generator might be common across completed return workflows but irrelevant to the first turn, when the customer is still asking whether an item qualifies. A mixed configuration lets you keep the lookup ready and defer the label generator. Tool Retrieval guide

Remote MCP servers make that choice coarser. Google lets you set defer_loading: true on an mcp_server declaration, which defers the schemas for every tool that server exposes. A connector dedicated to occasional inventory reconciliation is an easy candidate. A connector that combines the first lookup on most requests with a pile of specialist functions deserves its own comparison. Deferring the entire server could put a search in front of the busiest path. Measure how often a deferred server supplies the first useful call. That tells you more about where users will feel the change than the number of tools on the server. Tool Retrieval guide

Use client-side search when availability changes by user

Client-side retrieval gives the application control over the search. Declare a tool_search tool with execution set to client, define its input, and return matching function declarations when the model calls it. The application can query its own registry and filter the results to integrations available to that user. For example, a support agent can search a workspace’s connected services and return a shipping function only for workspaces that have that carrier configured. Each search adds a round trip because the application has to return the declarations in a follow-up request. The identity and workspace checks still belong where the function executes. Tool Retrieval guide · Function calling guide

The ranking problem is now yours, too. A query for “start a return” might mean checking eligibility or creating a label, depending on what the user has already done. Test both versions of that request with the relevant conversation history. Check the empty-result path as well, especially when a user asks for a tool from a disconnected integration. The registry may correctly return no matches. The agent still has to distinguish an unavailable integration from a request it can answer with another authorized function.

Replay real tasks before flipping the default

Start with the same eligible tool set, model, instructions, and conversation history. Replay representative tasks with all schemas loaded, then with server-side retrieval. Add a mixed configuration if the logs show a few functions dominate first calls. Include short requests that need no tools, routine lookups, ambiguous requests with near-duplicate functions, and multi-step tasks that bring in another tool late. Use recorded or sandboxed function responses so the replay produces comparable results without issuing a second label or touching a live order.

Score the completed task and the sequence that got it there. For the package question, did the agent look up the correct order and use the returned shipping status? For a return, did it check eligibility before creating the label, supply valid arguments, and report the outcome accurately? Record search counts, retries, total billed token usage, and elapsed time through task completion. Break out long conversations and slow requests so a cheaper median lookup cannot hide a longer wait on the workflows that use several tools. If the same function routinely triggers the first search, try loading it up front and rerun that slice. The preview gives you a way to test exactly how much it costs to make that function wait.

Frequently asked questions

Where is Tool Retrieval available?
It is in preview on the Gemini Interactions API’s v1beta endpoint for Gemini 3.6 and later, including the Gemini 4 family.

Does a server-side search add another API request from my app?
The search runs within the same API request and adds an internal model pass. Client-side search requires a follow-up request from your app.

Is there a separate Tool Retrieval fee?
Google bills standard model token rates. Include the additional search passes when comparing the cost of a complete task.

Share this article

> Want more like this?

Get the best AI insights delivered weekly.

By subscribing, you agree to our Privacy Policy. You can unsubscribe at any time.

> Related Articles