Gemini API tool retrieval for efficient agent scaling


From here it’s normal function calling: your code runs the refund and sends back a function_result.

There’s no index to build or host. Gemini runs the search on the server, so the only changes to your code are the new tool and a flag on the tools you want to defer. You can keep your most-used tools loaded up front and defer the long tail.

Tool Retrieval also plays well with prefix caching. Deferred schemas stay out of the start of the prompt, and the schemas the model loads are added later in the conversation, so the cached prefix stays the same from turn to turn.

Tool Retrieval also 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 can connect a large server without listing its tools one by one.

How client-side retrieval works

If you maintain your own tool registry, embedding index, or per-user permission filter, declare the tool_search with "execution": "client" and define your search parameters. Client-side retrieval adds one round trip per search, because your app runs the lookup. Tools do not need to be declared upfront, so you can also expose new tools mid-conversation when a user connects an integration:



Source link

Aadhya Chaubey

https://zenvolt.co.in/

Explore more

Categories

Tags

Related Articles

A 15-cm pink-and-white agate kept in a museum’s mineral collection for 175 years turned out to be a dinosaur egg discovered in India |

PC: National History Museum A 15-centimetre pink-and-white agate kept in the Natural History Museum’s mineral collection for 175 years is now believed to have formed inside a dinosaur egg, according to the museum. It was collected in central India and registered in 1883. Mineral Curator Robin Hansen realised its significance after a dealer showed her...

ZenVolt is an independent technology news and information platform covering Artificial Intelligence, emerging technologies, cloud computing, software, science, startups, and the digital world.

 

Zenvolt2026- keep in touch

Subscribe to our newsletter to get our newest articles instantly!