Skip to content

Gemini API adds on-demand tool schemas for larger agent toolkits

Google Gemini API on demand tool schemas

What happened

Google announced Tool Retrieval in preview for the Gemini Interactions API. Developers can defer tool parameter schemas while leaving each tool’s name and description visible. When the model selects a deferred tool, the API loads its schema and continues the call within the same request. The feature also supports remote MCP servers. There is no separate Tool Retrieval fee, but enabling tool_search adds a fixed block of input tokens, and loaded schemas use normal input-token billing. Source

Why it matters

For developers building agents around many integrations, this offers another way to manage context and token use without maintaining a separate search service. It also makes tool selection part of the runtime path, so teams should test whether their agents find the right tool and compare actual token use before adopting it broadly. The feature is still in preview and applies to the Gemini Interactions API.

My understanding

An agent with a large tool library can spend a lot of its prompt context describing tools it never uses. Tool Retrieval changes that trade-off: the model can see what tools exist, while the API loads detailed parameter schemas only for tools selected for the current task. That should help most when the library is large and each request uses only a small part of it. The savings are not automatic, though: Google still counts the search setup and any loaded schema as input tokens, so the benefit depends on how often tools are actually needed.

Takeaway

Defer rarely used tool schemas when the token cost of loading them on every request is greater than the cost of retrieving them when needed.

Sources

Read the original source