Gemini API adds on-demand tool retrieval
Google has launched Tool Retrieval in preview for the Gemini API, letting agents connected to large tool libraries load parameter schemas only when needed, which cuts token use and latency and improves tool-selection accuracy.
Google announced Tool Retrieval for the Gemini API. It is available in preview through the Interactions API. The feature targets agents wired to dozens or hundreds of tools, where sending every full parameter schema on each request raises input token counts, adds latency and lowers tool-selection accuracy as the list of candidates grows.
To use it, developers add a tool_search tool to the request and set defer_loading: true on the tools they want to hold back. The model still sees each deferred tool's name and description, but not its parameter schema. When it needs a tool, it requests the tool by name, the API loads the schema, and the model makes the function call, all within one request. Each step appears in interaction.steps, which helps with debugging. Google says no index has to be built or hosted because the search runs on its servers.
Deferred schemas are kept out of the start of the prompt, so the cached prefix stays stable across turns. Setting defer_loading on a remote MCP server defers every tool that server exposes. Teams that run their own registries or permission filters can choose client-side execution instead, which adds one round trip per search and lets them add new tools mid-conversation.
There is no separate charge. tool_search adds a small fixed block of input tokens, and every schema the model loads is billed as input for the rest of the conversation. Google says the savings depend on how many schemas go unused and advises developers to measure against their own traffic. The feature works with Gemini 3.6 and later, including all Gemini 4 models.