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.