HAVE AI NEWS HAVE AI NEWS
tg subscribe
Tools

Google introduces Tool Retrieval for Gemini: fewer tokens when working with hundreds of tools

Google introduces Tool Retrieval for Gemini: fewer tokens when working with hundreds of tools

The new Gemini API mechanism loads tool schemas only on request. In Google's calculated scenario, token usage for an agent with 200 functions falls from approximately 164,000 to 23,650.

Google has added the Tool Retrieval mechanism to the Gemini API, designed for AI agents with large function catalogs and connected MCP servers. Full tool schemas do not fit into the context in advance: the model receives them only when it determines that a specific call is necessary.

The feature is available in preview within the Interactions API. It is not yet supported in the classic generateContent.

How deferred loading works

The developer declares a special search tool and adds the defer_loading: true parameter to rarely used functions. Before a search, the model sees the name and short description of each such function, but not its parameters. According to Google's estimate, this takes about 26 tokens per tool.

If a function is suitable for the current task, the model requests its schema by name. The API adds the parameter description to the context, after which the model performs the call. The entire process takes place within a single request.

An entire remote MCP server can also be deferred. Its tools will be loaded as needed, and the schemas that appear will be saved in the history of the current conversation. The initial part of the prompt remains unchanged and can use caching.

Google's calculation: 200 tools require significantly fewer input tokens

Google's documentation provides a theoretical scenario rather than the result of an independent measurement. For an agent with a library of 200 tools, it specifies approximately 23,650 input tokens when using Tool Retrieval, compared with 164,000 when all schemas are passed normally. The difference is approximately 86%, or nearly seven times.

The company does not claim a separate fee for the mechanism: standard pricing for the selected model applies. However, server-side search launches an additional model pass with context, so the savings depend on the number of search operations and the amount of cacheable data.

When the technology is worthwhile

With a small and stable set of functions, deferred loading may prove disadvantageous. In Google's example with 10 tools and a context of 30,000 tokens, total usage would amount to 92,830 tokens instead of 68,000—approximately 36.5% more.

The Gemini 4 Hydrogen pricing was used to illustrate the financial impact: $1.50 per 1 million input tokens. In the scenario with 200 tools, the cost of one conversation is estimated at $0.246 with conventional loading and approximately $0.035 with Tool Retrieval. For 10,000 conversations, the difference would be about $2,100. Output tokens and cache costs are not included in the calculation; cached Hydrogen input costs $0.075 per 1 million tokens.

Google recommends the traditional approach for libraries of approximately up to 20 stable tools. If you have your own catalog or a complex permissions system, you can use the client-side mode execution: "client". It allows functions to be searched on the application side and new integrations to be added directly during the conversation, but each search requires an additional exchange with the model.

Comparison with Anthropic and OpenAI solutions

In terms of interface, Gemini's implementation is similar to the search tools from Anthropic and OpenAI: they use tool_search, deferred loading, and a choice of how the search is executed. However, the platforms show the model different portions of the catalog before the search begins.

ParameterGemini APIClaude APIOpenAI Responses API
What is available before the searchThe name and description of each deferred functionThe search tool itself and functions without deferred loadingFunction names and descriptions; for namespaces and MCP servers, a general description
Search mechanismRequesting schemas by exact nameRegular expression or BM25, up to 5 results by defaultLoading individual functions, namespaces, or MCP servers
Supported modelsGemini 3.6 and later, including Gemini 4 NeonClaude 4.5 and laterGPT-5.4 and later
Claimed savingsNot stated separately; approximately 86% in the calculated exampleMore than 85%47%

Gemini's approach involves a trade-off: even the deferred catalog is partially present in every request. For example, 1,000 functions at 26 tokens each amount to approximately 26,000 input tokens even before a search. In Anthropic's system, deferred tools are not added to the initial context, and the permitted catalog size reaches 10,000 tools per request.

The percentages cannot be compared directly: the companies used different conditions and methodologies. Google also did not publish its own tool-selection accuracy figures. Anthropic reported that, on internal tasks with MCP, Claude Opus 4.5's accuracy increased from 79.5% to 88.1% when using Tool Search.

Limitations of the current version

  • The feature is in preview, so the API may change before general release.
  • A loaded schema cannot be removed before the conversation ends.
  • Additional search passes may increase costs with a small catalog.
  • There is no separate charge for server-side search, but processed tokens are billed at the model's standard rate.

Thus, Tool Retrieval is primarily intended for agents with dozens or hundreds of tools. With large libraries, it can significantly reduce the size of the initial context, but for small sets of functions, passing schemas normally may remain more efficient.

Author: Boris Sedu

Source: neurohive.io

Google introduces Gemini 4 Neon for fast, complex AI workflows
Models

Google introduces Gemini 4 Neon for fast, complex AI workflows

Gemini 4 Neon is Google’s new frontier-level model for software engineering, enterprise analysis, science, cybersecurity and long-running agent tasks. It offers a one-million-token context window, flexible reasoning levels and lower per-task costs, with access beginning across Google AI Studio, Gemini for business, Antigravity and the Gemini app.

Google Releases Gemini 4 Neon: New Model Nearly Catches Up with Flagship Carbon
Models

Google Releases Gemini 4 Neon: New Model Nearly Catches Up with Flagship Carbon

Gemini 4 Neon is Google’s fourth model in two months, delivering strong results in 16 of 19 tests and offering a lower API price than its competitors.

Gemini 4 Carbon Now Available to Developers and Businesses
Models

Gemini 4 Carbon Now Available to Developers and Businesses

Google has opened access to Gemini 4 Carbon, its most powerful model for complex software development, scientific research, data analysis and cybersecurity.

Google introduces Gemini 4 Hydrogen for agentic tasks
Models

Google introduces Gemini 4 Hydrogen for agentic tasks

Gemini 4 Hydrogen is Google’s new fast model for coding, multi-step agent workflows, multimodal data processing, and everyday tasks.

Google Antigravity Unexpectedly Shrinks Context: Gemini’s Solution
Models

Google Antigravity Unexpectedly Shrinks Context: Gemini’s Solution

Antigravity 2.0 has no built-in context window indicator, so a developer created the chat_tokens plugin and the ContextRing macOS app.

Genie 4 is now available in Project Genie
Models

Genie 4 is now available in Project Genie

Google is bringing Genie 4 to eligible AI Ultra subscribers through Project Genie, adding real-time world editing, native audio, an AI creation agent and a community gallery.