metir
metir
Docs
Download on App StoreGet it on Google PlayLog inSign up
Back to Blog
Gemini API
Tool Retrieval
MCP
AI Agents
Google

Gemini API Tool Retrieval: defer_loading and tool_search

Google's Gemini API Tool Retrieval preview defers tool schemas with tool_search and defer_loading. How it works, what it costs, and where its limits sit.

Metir AI TeamNovember 29, 20266 min read
Gemini API Tool Retrieval: defer_loading and tool_search

Gemini API Tool Retrieval is a preview feature in the Interactions API that lets an agent work with a large tool library without sending every tool's full parameter schema on each request. Google announced it on November 19, 2026, describing it as a way to load tool parameter schemas on demand, with fewer input tokens, lower latency and more accurate tool selection as the number of tools grows.

Google logoGoogle
Gemini logoGemini
Tool Retrieval ships in the Gemini Interactions API.

How Gemini tool retrieval works

According to Google's announcement, setup has two parts: add a tool_search tool to the request, then set defer_loading: true on the function tools to hold back. The model still sees each deferred tool's name and description but not its parameter schema. When it needs one, it requests the tool by name, the API loads the schema, and the model emits the function call, all within one request.

The search runs on Google's servers, so there is no index to build or host. The interaction.steps list exposes tool_search_call, tool_search_result and function_call steps for debugging. Google's guidance is to keep frequently used tools undeferred and defer the long tail. Deferred schemas stay out of the start of the prompt and loaded schemas are appended later, so the cached prefix stays the same across turns.

Nov 19, 2026Preview announced
v1betaRequired API version
1tool_search entry allowed per request
~26 tokensPer deferred tool, early testing

MCP servers and client-side retrieval

Setting defer_loading: true on an mcp_server tool defers every tool that server exposes, so a large remote MCP server can be connected without listing its tools one by one. Teams with their own registry, embedding index or per-user permission filter can instead declare tool_search with "execution": "client". Each search then adds one round trip because the application does the lookup, but tools do not need to be declared upfront, so new ones can appear mid-conversation, for example when a user connects an integration. The documentation states that defer_loading works only with server-side retrieval and that the two modes cannot be combined in one request.

Supported models and requirements

Tool Retrieval works only on the Interactions API and requires the v1beta version; generateContent does not support it. Google's blog says it covers Gemini 3.6 and later models, including all Gemini 4 models. The documentation lists gemini-4-carbon, gemini-4-neon, gemini-4-hydrogen, gemini-4-argon, gemini-3.8-flash and gemini-3.6-flash. Setting defer_loading on an unsupported model returns a 400 error.

What it costs: loaded schemas are billed as input

There is no separate charge. Per the documentation, tokens bill at the model's standard input, cached and output rates, with three details that matter for planning:

  • Deferred tools add only a name and short description to input tokens. Schemas are not billed until loaded.
  • Each schema the model loads is billed as input for the rest of the conversation, the same as a tool declared upfront.
  • Each server-side search makes an extra model call whose prompt tokens appear in total_tool_use_tokens and bill at the input rate.

The documentation also notes that implicit caching still applies, but deferring tools can shrink a prompt below the model's minimum cacheable size. Google states that savings occur when unloaded schemas outweigh loaded ones, the usual case for large libraries, and recommends measuring on your own traffic. It publishes no savings figure.

A token model, clearly illustrative

The chart below is our arithmetic, not a benchmark. It assumes 100 tools, 400 tokens per full schema (our assumption, since Google gives no average schema size) and the roughly 26 tokens per deferred tool line that PPC Land reports from Google's documentation as an early-testing figure. It leaves out the fixed tool_search block and the extra model pass per search.

Illustrative tool-definition tokens per request, 100 tools

Arithmetic from stated assumptions, not a benchmark: 400 tokens per full schema (our assumption) and about 26 tokens per deferred tool line (Google documentation, early testing).

Illustrative arithmetic. Excludes the fixed tool_search block and the extra model pass each server-side search adds, which Google says bill at the input rate.

Under those assumptions, loading all 100 schemas costs 40,000 tokens per request, while deferral costs 2,600 plus 400 for each tool actually loaded. The gap narrows as more tools load, and it reverses for small libraries, which the documentation says may cost less with static loading.

Google sign on Charleston Road in Mountain View, California
A Google sign at 1565 and 1585 Charleston Road, Mountain View, photographed in 2022. The photo shows the campus, not the Gemini API. Credit: Dietmar Rabich, CC BY-SA 4.0.

Limits to plan around

The documentation lists several constraints:

  • Loaded tools stay in context for the rest of the conversation and cannot be unloaded.
  • The full tools array must be resent on every request, including multi-turn calls.
  • A search that matches nothing returns a text response, not a structured error, so misses take deliberate monitoring.
  • Replayed history must include every tool_search_call step and its signature unchanged, or the request fails with a 400.
  • Tools named in system instructions or in other tools' output should not be deferred, because calling one without a search also fails.

PPC Land's write-up also points out that the blog's "3.6 and later" wording and the documentation's model list differ, and that Google does not say which is current. Since it is a preview, the API surface may change before general availability.

How it compares with Anthropic and OpenAI

Google is not the first. Anthropic published its advanced tool use post on November 24, 2025, introducing a tool search tool with the same defer_loading flag. In Anthropic's own testing, a setup with 50+ MCP tools went from about 77K tokens to about 8.7K, and accuracy on its internal MCP evaluations rose from 49% to 74% on Opus 4 and from 79.5% to 88.1% on Opus 4.5. PPC Land's comparison says OpenAI added a similar defer_loading option with GPT-5.4 in March 2026 and reported a 47% reduction in total token usage in its own tests; we did not open OpenAI's documentation, so treat that as secondhand. Each vendor's figures come from its own tests on its own models and are not directly comparable, and Google has published none.

What it means for agent builders

The flag name is converging across vendors, which lowers the cost of trying the pattern. The harder questions are retrieval quality, observability of misses and cache behavior. Teams that run several model providers, as in a multi-model tool such as Metir, will likely keep tool catalogs provider-neutral and treat deferral as a per-provider setting. Until Google publishes measurements, the practical step is the one it recommends: test on your own traffic.

Sources:

  • Introducing Tool Retrieval in the Gemini API (Google)
  • Tool Retrieval documentation (Google AI Studio)
  • Google shrinks idle tools in Gemini agents to about 26 tokens each (PPC Land)
  • Advanced tool use (Anthropic Engineering)

Image credits

  • Google campus, Mountain View, photographed October 6, 2007: Sebastian Bergmann, CC BY-SA 2.0, via Wikimedia Commons.
  • Google sign, Charleston Road, Mountain View, June 30, 2022: Dietmar Rabich, CC BY-SA 4.0, via Wikimedia Commons.

Ready to experience AI that adapts to you?

metir brings together the world's best AI models in one seamless experience. Start for free today.

Get Started Free
metir

metir is where work gets done. Hire your team of Orbs, AI teammates with their own computer, alongside your mail, meetings and workspace.

© 2026 metir. All rights reserved.

Product

  • Pricing
  • Research
  • Docs
  • Blog
  • Enterprise

Company

  • Docs
  • Support
  • Careers

Legal

  • Terms of service
  • Privacy policy

Personalisation is powerful. Privacy is non-negotiable.

Status: All systems operational