Gemini API

Gemini API adds Tool Retrieval in preview for large tool libraries

Published · By Editorial team promptdonuts.com

Google has added Tool Retrieval to the Interactions API of the Gemini API, as a preview. You add a tool_search tool to the request and set defer_loading: true on the function tools to hold back. The model sees only each held-back tool's name and description, and Gemini loads the full parameter schema in the same request when the model needs it. Remote MCP servers can be deferred as a whole. It works with Gemini 3.6 and later, including all Gemini 4 models. There is no separate charge, but each loaded schema counts as input for the rest of the conversation. You can also run the search on your own side, which adds one round trip per search.

Why it matters: The model now picks tools from their names and descriptions alone, so those two lines carry more weight than before. Rewrite your descriptions so each one says when to use the tool and when not to, and keep your most used tools undeferred.

Try this

Gemini API

Rewrite tool descriptions for deferred loading

I have an agent with many tools. The model will only see each tool's name and a short description before it decides to load the full schema. Rewrite each description below so that it states, in one or two sentences, what the tool does, when to use it, and when a similar tool is a better choice. Keep the names unchanged and do not invent features. Tools: [LIST OF TOOL NAMES WITH THEIR CURRENT DESCRIPTIONS] After the rewrites, list any two tools whose descriptions could still be confused and suggest how to tell them apart.

Sources: Google: Introducing Tool Retrieval in the Gemini API

Guide: Prompt engineering: how it works, with prompts to copy

MORE AI NEWS

ALL NEWS