<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/spring-ai-2-0-tool-search-cut-token-costs-by-5x-idupngixw" -->

---
title: Spring AI 2.0 Tool Search: Cut Token Costs by 5x | daily.dev
description: Spring AI 2.0 introduces a tool search capability that solves the problem of context window bloat when registering many tools with an LLM. Instead of sending...
canonical: https://daily.dev/posts/spring-ai-2-0-tool-search-cut-token-costs-by-5x-idupngixw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Spring AI 2.0 Tool Search: Cut Token Costs by 5x | daily.dev
og:description: Spring AI 2.0 introduces a tool search capability that solves the problem of context window bloat when registering many tools with an LLM. Instead of sending...
og:url: https://daily.dev/posts/spring-ai-2-0-tool-search-cut-token-costs-by-5x-idupngixw
og:image: https://api.daily.dev/og/posts/IdupnGiXW.png
og:image:alt: Spring AI 2.0 Tool Search: Cut Token Costs by 5x
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Spring AI 2.0 Tool Search: Cut Token Costs by 5x

**[Dan Vega](https://daily.dev/sources/dan-vega)** · 25 min read · 2 upvotes · 0 comments

## Summary

Spring AI 2.0 introduces a tool search capability that solves the problem of context window bloat when registering many tools with an LLM. Instead of sending all tool definitions with every request (which can consume 5,000+ tokens before a user even asks a question), the tool search pattern exposes a single search tool initially. The model queries it with natural language to discover relevant tools on demand. The tutorial walks through setting up a Spring Boot 4 project with Anthropic, configuring the tool search advisor with vector-based semantic search, and demonstrates a 5x token reduction (from ~5,100 to ~1,166 tokens) on a real example with 47 tools. Three search strategies are available: semantic (vector), keyword, and regex. The feature is most valuable when working with 10+ tools, MCP-powered systems with multiple servers, or when tool definitions exceed 10,000 tokens.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=VG00DildlvY>

## Questions this post answers

### What is tool search in Spring AI 2.0 and how does it reduce token costs?

Tool search is a Spring AI 2.0 feature that exposes only a single search tool to the model initially instead of registering every available tool's schema on each request. When a capability is needed, the model queries the tool search with natural language, and matching tool definitions are dynamically expanded into context. In a demo with 47 tools, this cut token usage from about 5,166 tokens per request to roughly 1,166 tokens, a five times reduction, while still returning correct results.

_Developers optimizing LLM tool integrations can follow ongoing Spring AI updates like this on daily.dev._

### What search strategies does the Spring AI 2.0 tool index support?

The tool index interface in Spring AI 2.0 supports three built-in search strategies: semantic (vector-based), keyword, and regex. Regex is the default auto-selected strategy, but semantic search using an in-memory vector store is recommended when tool descriptions need natural-language matching. Configuration options include setting the tool index type, a max results limit, and whether to accumulate discovered tools across a session.

_daily.dev helps engineers comparing tool-search strategies stay current on Spring AI configuration options._

### When should I use Spring AI's tool search advisor instead of loading all tools directly?

Tool search is recommended when a system has 10 or more tools, tool definitions consume more than 10,000 tokens, the application uses MCP-powered systems with multiple servers, or tool selection accuracy suffers with large tool sets. For a small number of frequently used, compact tools, the traditional approach of loading all tools directly remains simpler and doesn't need dynamic search.

_Teams deciding how to scale LLM tool integrations can track guidance like this on daily.dev._

## Similar posts on daily.dev

- [Spring AI’s Dynamic Tool Discovery](https://daily.dev/posts/spring-ai-s-dynamic-tool-discovery-k2apeohgr) · Baeldung · 0 upvotes · 0 comments
- [Smart Tool Selection: Achieving 34-64% Token Savings with Spring AI's Dynamic Tool Discovery](https://daily.dev/posts/smart-tool-selection-achieving-34-64-token-savings-with-spring-ai-s-dynamic-tool-discovery-n1bvjlpdj) · Spring · 2 upvotes · 0 comments
- [Cut Agent Token Costs with Toolboxes and Tool Search in Microsoft Foundry](https://daily.dev/posts/cut-agent-token-costs-with-toolboxes-and-tool-search-in-microsoft-foundry-xiojxl4cb) · C\# Corner · 0 upvotes · 0 comments
- [Tool descriptions are eating up all your AI tokens \(but they don’t have to\)](https://daily.dev/posts/tool-descriptions-are-eating-up-all-your-ai-tokens-but-they-don-t-have-to--ccj24l08j) · CNCF · 0 upvotes · 0 comments
- [Why your AI pipeline costs 10x more after the demo](https://daily.dev/posts/why-your-ai-pipeline-costs-10x-more-after-the-demo-loavt2qiu) · The New Stack · 0 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#java](https://daily.dev/tags/java), [#spring-ai](https://daily.dev/tags/spring-ai)

[View this post on daily.dev](https://daily.dev/posts/spring-ai-2-0-tool-search-cut-token-costs-by-5x-idupngixw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Spring AI 2.0 Tool Search: Cut Token Costs by 5x","url":"https://daily.dev/posts/spring-ai-2-0-tool-search-cut-token-costs-by-5x-idupngixw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/spring-ai-2-0-tool-search-cut-token-costs-by-5x-idupngixw"},"datePublished":"2026-07-09T12:16:05.000Z","dateModified":"2026-09-14T08:51:45.040Z","description":"Spring AI 2.0 introduces a tool search capability that solves the problem of context window bloat when registering many tools with an LLM. Instead of sending...","image":"https://i.ytimg.com/vi/VG00DildlvY/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/VG00DildlvY/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Dan Vega","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Dan Vega","logo":"https://media.daily.dev/image/upload/s--qCQZxa91--/f_auto,q_auto/v1773648785/logos/dan-vega?_a=BAMAMiiu0","url":"https://daily.dev/sources/dan-vega"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/spring-ai-2-0-tool-search-cut-token-costs-by-5x-idupngixw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,java,spring-ai","timeRequired":"PT25M","video":{"@type":"VideoObject","name":"Spring AI 2.0 Tool Search: Cut Token Costs by 5x","description":"Spring AI 2.0 introduces a tool search capability that solves the problem of context window bloat when registering many tools with an LLM. Instead of sending...","thumbnailUrl":"https://i.ytimg.com/vi/VG00DildlvY/sddefault.jpg","uploadDate":"2026-07-09T12:16:05.000Z","duration":"PT25M","url":"https://api.daily.dev/r/IdupnGiXW","embedUrl":"https://www.youtube.com/embed/VG00DildlvY"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Dan Vega","item":"https://daily.dev/sources/dan-vega"},{"@type":"ListItem","position":3,"name":"Spring AI 2.0 Tool Search: Cut Token Costs by 5x"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/spring-ai-2-0-tool-search-cut-token-costs-by-5x-idupngixw#faq","mainEntity":[{"@type":"Question","name":"What is tool search in Spring AI 2.0 and how does it reduce token costs?","acceptedAnswer":{"@type":"Answer","text":"Tool search is a Spring AI 2.0 feature that exposes only a single search tool to the model initially instead of registering every available tool's schema on each request. When a capability is needed, the model queries the tool search with natural language, and matching tool definitions are dynamically expanded into context. In a demo with 47 tools, this cut token usage from about 5,166 tokens per request to roughly 1,166 tokens, a five times reduction, while still returning correct results. Developers optimizing LLM tool integrations can follow ongoing Spring AI updates like this on daily.dev."}},{"@type":"Question","name":"What search strategies does the Spring AI 2.0 tool index support?","acceptedAnswer":{"@type":"Answer","text":"The tool index interface in Spring AI 2.0 supports three built-in search strategies: semantic (vector-based), keyword, and regex. Regex is the default auto-selected strategy, but semantic search using an in-memory vector store is recommended when tool descriptions need natural-language matching. Configuration options include setting the tool index type, a max results limit, and whether to accumulate discovered tools across a session. daily.dev helps engineers comparing tool-search strategies stay current on Spring AI configuration options."}},{"@type":"Question","name":"When should I use Spring AI's tool search advisor instead of loading all tools directly?","acceptedAnswer":{"@type":"Answer","text":"Tool search is recommended when a system has 10 or more tools, tool definitions consume more than 10,000 tokens, the application uses MCP-powered systems with multiple servers, or tool selection accuracy suffers with large tool sets. For a small number of frequently used, compact tools, the traditional approach of loading all tools directly remains simpler and doesn't need dynamic search. Teams deciding how to scale LLM tool integrations can track guidance like this on daily.dev."}}]}
```

