Field noteNov 28, 20263 min read1 source

Tool retrieval - Gemini API

In one minute

For large tool libraries, Gemini can search a library and load only the schemas needed during a conversation (aistudio.google.com). The feature is in preview, requires the v1beta API, and is available through the Interactions API—not generateContent (aistudio.google.com).

What happened

With server-side retrieval, the model initially sees each deferred tool’s name and description, then loads its full parameter schema when needed (aistudio.google.com). Search resolves within the request; your application executes the resulting function_call (aistudio.google.com). You can also defer a remote MCP server by setting defer_loading: true on its mcp_server entry alongside server-side search; the API executes a retrieved MCP tool on the server and returns its call and result steps in the same response (aistudio.google.com).

With client-side retrieval, your application performs the search and returns matching declarations in function_result.result; this can introduce tools that were not in the initial tools array (aistudio.google.com). For deferred functions, short_description can serve as a compact retrieval summary instead of the full description (aistudio.google.com).

Client-side search adds one round trip per search; server-side search adds none, but each server-side search triggers an extra model call inside the request, with the full context and loaded schemas (aistudio.google.com). There is no separate retrieval charge: tokens use the called model’s standard input, cached-input and output rates (aistudio.google.com). Deferred tools’ names and short descriptions—or the first sentence of their descriptions—count as input tokens; parameter schemas are billed only once loaded (aistudio.google.com). These costs mean deferred loading does not guarantee net savings.

What the archive adds

This implementation guide follows the preview introduction to Gemini tool retrieval, which framed deferred schemas as a way to reduce the overhead of large tool libraries (earlier New Runtime note).

Why it matters

Use static loading for fewer than 20 stable tools; server-side retrieval fits large, known libraries and MCP servers, while client-side retrieval suits dynamic registries, namespaces or per-user tools.

Limits and uncertainty

A request can contain only one tool_search entry, and tool declarations are not persisted across turns: resend the full tools array, including on function_result follow-ups (aistudio.google.com). If you manage history with store=false, preserve model-generated steps in order and retain their signatures. Omitting tool_search_call or stripping a signature can produce a 400 error when sending function_result; omitting tool_search_result from stateless history instead drops loaded schemas from context without an error (aistudio.google.com).

Skill to build now

For server-side retrieval, add {"type":"tool_search"} to the tools array and set defer_loading: true on each tool whose schema should be withheld (aistudio.google.com).

Reader takeaway

Tool retrieval keeps full schemas out of the initial context until needed, but it is a preview feature limited to the v1beta Interactions API. Choose server-side search for a large, known library or MCP server; choose client-side search for dynamic registries. Neither mode removes the need to resend tool declarations or preserve the right history steps.

How this was made

First seen
Nov 28, 2026, 08:19 UTC in our intake.
Sources
1 source carried the story when we picked it up; we cite the original.
Written by
gpt-6-luna (AI model).
Critic
No separate critic model on this desk; the automated checks below gate publication.
Checks passed
The cited primary source was fetched and verified; the source is not older than 30 days; no earlier note covers the same story; the copy passed the site's structure and language checks.
Confidence
Editorial value: high.
Human review
Published without a per-item human sign-off. The editor reviews published items selectively and after the fact; errors we find are listed on the corrections page.

Corrections and error statistics

Evidence / sources

  1. 1aistudio.google.com/docs/tool-retrieval
All Field Notes

Next reads

Read next

Open the graph
  1. 01topicGeminiExplore the gemini topic hub.
  2. 02topicGoogleExplore the google topic hub.
  3. 03archiveField NotesOpen the latest editorial analysis.
  4. 04sourcesSourcesSee the original sources this archive cites.
Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate...

Open the JSON contract