Introducing Tool Retrieval in the Gemini API

Give your agents access to hundreds of tools while using fewer tokens with Tool Retrieval, now in preview in the Gemini API.

Đăng bởi
Google
Ngày đăng
Độ dài
216 từ · 1 phút
Introducing Tool Retrieval in the Gemini API

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:

Bài viết này từ đâu mà có

Bài viết này được Google đăng lần đầu vào 19 tháng 11, 2026. HUE Legacy Ventures không phải tác giả của bài viết.

Carried in full with attribution and a link to the original. Rights remain with the publisher, who may request removal at any time.

Đọc tại blog.google →