Gemini tool retrieval is in Preview on the Interactions API: defer_loading plus tool_search, MCP included (November 19, 2026)
Mark tools defer_loading: true and add a tool_search tool, or run your own search with execution: client. Interactions API only.
Your keys
0 of 1 ready
Create each key on its own page, paste it below, then copy the finished lines into your project's .env file. Your keys stay in this tab. They are never sent to Wirestack or saved; we only count that the panel was used.
- Google Gemini API API keyGEMINI_API_KEYGet key
Click Create API key
What changed
Tool retrieval is in Preview on the Interactions API. Gemini can search your tool library and load function schemas on demand, so large tool sets no longer go in full on every request. It requires the v1beta API version, and the generateContent method does not support it.
Server-side retrieval is the default. Add {"type": "tool_search"} to your tools and set defer_loading: true on each function tool you want to hold back. The model sees the name and description of each deferred tool, not its parameter schema, loads the schema when it needs it, and calls the function in a single API request. The response carries tool_search_call and tool_search_result steps, then the function_call step your app runs.
Remote MCP servers support defer_loading too. Set it on an mcp_server tool alongside a server-side tool_search and every tool that server exposes is deferred. When the model calls a deferred MCP tool, the API runs it on the remote server and returns mcp_server_tool_call and mcp_server_tool_result steps in the same response.
Client-side retrieval: declare a tool_search tool with execution: "client", a required name and description, and optional search parameters. The model calls it like a normal function. Your app runs its own search and returns complete function declarations in the function_result. Each client-side search adds one round trip, so the docs point latency-sensitive apps to server-side retrieval.
Rules from the docs: one tool_search tool per request. You cannot mix server-side and client-side retrieval in one request. defer_loading without a server-side tool_search returns an error. Retrieved tools stay in context for the rest of the conversation. Tool declarations are not stored between requests, so send the full tools array every time. The optional short_description field works only on functions with defer_loading: true.
Tool retrieval has no separate charge. Deferred tools add only their name and short_description (or the first sentence of description) to total_input_tokens. Each server-side search runs an extra model call inside the request, reported in and billed at the input rate.
Affected by this? Start from a checked Google Gemini API integration
Code with pinned versions, checked against the official docs on a schedule.
