# Gemini API Tool Retrieval: many tools, fewer tokens

> Tool Retrieval, in preview in the Gemini Interactions API since 2026-11-19, loads a tool's parameter schema, the description of the inputs the tool accepts, only when the model needs it. No separate charge.

- Published: 2026-11-20
- Publisher: Rig Labs (https://riglabs.ai/)
- Canonical: https://riglabs.ai/blog/gemini-api-tool-retrieval/
- Answers: Gemini API Tool Retrieval
- Agent file (a short card for your agent): https://riglabs.ai/blog/gemini-api-tool-retrieval/AGENT.md

---

Google launched Tool Retrieval in the Gemini API on November 19, 2026, in preview in the Interactions API: an agent keeps its whole tool library on standby and loads a tool's parameter schema (the description of the inputs the tool accepts) only when the task needs it, per [Google](https://blog.google/innovation-and-ai/technology/developers-tools/gemini-api-tool-retrieval/). It works with Gemini 3.6 and later models and has no separate charge.

What you can now do: if you build agents on the Gemini API, connect dozens or hundreds of tools (or a large MCP server) without sending every tool's full definition on every request.

## What problem does Tool Retrieval solve?

Tool Retrieval addresses the cost of big tool lists. When an agent connects to dozens or hundreds of tools, sending every full parameter schema on every request "inflates input token counts, adds latency, and lowers tool-selection accuracy as the candidate list grows," write Google's Lucia Loher and Nora Kassner. A parameter schema is the description of the inputs a tool accepts.

## How does Tool Retrieval work?

Tool Retrieval needs two changes to a request, per Google's post:

- Add a tool of type `tool_search`.
- Set `defer_loading: true` on each tool you want to hold back.

The model still sees the name and description of every deferred tool. When it needs one, it asks for it by name, the API loads the full schema, and the model calls the function, all inside the same request. Google says there is "no index to build or host": Gemini runs the search on the server. The three steps (search call, search result, function call) appear in `interaction.steps`, which helps when you debug tool names and descriptions.

## Does Tool Retrieval work with MCP servers?

Tool Retrieval works with remote MCP servers in the Gemini API. Set `defer_loading: true` on an `mcp_server` tool, and every tool that server exposes is loaded on demand, so you do not list its tools one by one, per Google. If you keep your own tool registry or a per-user permission filter, you can run the search yourself by declaring `tool_search` with `"execution": "client"`. That adds one round trip per search.

## What does Tool Retrieval cost?

Tool Retrieval has no separate charge: tokens are billed at the standard rates of the model you call, per Google. Three details decide how many tokens you pay for:

- Turning on `tool_search` adds a small, fixed block of input tokens.
- Each schema the model loads is billed as input for the rest of the conversation, like a tool declared up front.
- You save when the schemas you never load outweigh the ones you do, "which is the usual case for large libraries."

Google's advice is to measure the saving on your own traffic. Deferred schemas stay out of the start of the prompt, so the cached prefix stays the same from turn to turn.

## What to do today

Count the tools your Gemini agent sends on each request. If the list is long, keep your most-used tools loaded up front and defer the rest, as Google suggests. Its example marks one function this way:

```python
tools = [
    {"type": "tool_search"},
    {
        "type": "function",
        "name": "issue_refund",
        "description": "Refund an order to the original payment method.",
        "defer_loading": True,
        "parameters": {...},
    },
]
```

Then compare input tokens per request before and after on a day of real traffic.

Last checked 2026-11-20.

Sources:
- [Google: Introducing Tool Retrieval in the Gemini API, Lucia Loher and Nora Kassner, 2026-11-19](https://blog.google/innovation-and-ai/technology/developers-tools/gemini-api-tool-retrieval/)
- [@googledevs on X, 2026-11-19](https://x.com/googledevs/status/2123493028732207296)
