ContentsStart0%
For the past two decades, finding a service usually started with typing a query into a search engine, reviewing the results and choosing a website. Companies built marketing strategies around that journey, from SEO and search advertising to app store optimization (ASO). The rise of AI agents introduces another way to choose a service.
Imagine you manage marketing for an ecommerce company and want to know why revenue fell last month. You might open Google Analytics 4 (GA4), Meta Ads, Google Ads and the store dashboard, download their reports and compare them in Excel. Today you can ask, “Find out why revenue dropped last month and suggest what we can improve.” An AI agent with the right tools and permissions can collect the data, run the analysis and prepare a report.
With hundreds of analytics services, thousands of marketing tools and many APIs offering similar capabilities, how does an agent choose when the user names no brand? Your service could drop out of contention before anyone sees it. Tool retrieval is part of the architecture of an AI agent, but it may also determine how digital services attract traffic and win business.
What is tool retrieval?
Tool retrieval is how an AI system identifies candidate tools that could help with a user's request, given the task context or an intermediate reasoning step. A tool is an external capability the system can invoke through an interface: a web API, a program function, an MCP tool, a database query interface or a third-party service.
A large language model (LLM) can reason about how to assess an ad campaign. Its training data cannot tell it how much your company spent yesterday. It can interpret a scheduling request but needs access to a calendar to create the event. Tools supply those capabilities. Typically the model sees their names, descriptions and input specifications. Tool retrieval finds promising candidates among those definitions before the model acts.
Why can't the AI just read every tool?
Developers can put five or ten tool definitions directly in a prompt. With hundreds or tens of thousands, context length, computation and interference between similar tools become significant. Qin and colleagues' ToolLLM, published at ICLR 2024, collected over 16,000 RESTful APIs from a real marketplace. At that scale, a dedicated API retriever narrows the list before it reaches the model.
The 2025 paper Retrieval Models Aren't Tool-Savvy: Benchmarking Tool Retrieval for Large Language Models puts numbers on that cost. ToolRet includes 43,215 tools, with documentation averaging 174.56 tokens each. Loading all the tool definitions would take roughly 7.54 million tokens, before the user's instructions, conversation history, tool results or system prompt. Even a model with room for this material would incur latency and cost and have to distinguish thousands of irrelevant options. Large systems often retrieve a shortlist first, then load detailed definitions as the task requires.
How does AI search a large tool collection?
Much of tool retrieval comes from information retrieval (IR). A web search engine matches a query against indexed pages. A tool retriever searches names, descriptions, parameters and other indexed metadata for an executable capability. A system can use keyword retrieval, semantic retrieval or reranking, often in successive stages.
Keyword search (sparse retrieval)
Sparse retrieval scores overlap between a query and a tool description, weighting terms by importance. BM25 considers both frequency within the document and rarity across the collection. For a query about organic search performance, a tool that mentions “Google Search Console,” “search impressions” and “organic search clicks” has a strong lexical match.
This approach is fast and interpretable. It works particularly well for brands, product names, API terms and precisely named functions. When the user's wording differs from a tool description, however, it can miss a capable tool just because the user doesn't know the technical field name.
Semantic search (dense retrieval)
Semantic retrieval uses an embedding model to encode the request and the tool description as vectors. Their distance represents similarity in meaning. A user might ask, “How many people have been coming to my site lately?” without mentioning GA4 or sessions. Dense retrieval can still associate the question with website analytics.
Users can make requests in everyday language. The trade-off is that semantically close tools can have different capabilities. A tool that only reports search impressions might rank near one that returns actual visitor counts, placing a topically relevant but unsuitable tool on the shortlist.
Reranking
After initial retrieval, a reranker such as a cross-encoder compares the query with each candidate's full description. Because this costs more, systems often rerank only a few dozen candidates. From thirty website analytics tools, for example, a reranking model can distinguish tools that retrieve traffic from those that report rankings or only generate reports.
Reranking works within the list it receives. It cannot recover a necessary tool missed in the first pass. Sparse and dense retrieval can operate independently or in a hybrid system, combining both to broaden recall and using reranking to refine the order. The architecture and candidate limit depend on the system's latency budget.
How do retrieval, selection and calling differ?
Tool retrieval, tool selection and tool calling address different questions. Failure at any stage can look the same to a user: the AI did not use the service successfully.
| Stage | Question | What it does |
|---|---|---|
| Tool retrieval | Which tools might help? | Find candidates in the collection |
| Tool selection | Which tool should I use? | Choose a tool for the current task |
| Tool calling | How do I invoke this tool? | Generate arguments and issue the call |
| Tool execution | Did the operation succeed? | Run the function and return its result |
A service with full GA4 query support cannot be chosen if the model never sees it. Once shortlisted, a vague description may still lose to a clearly scoped alternative. Even when the model chooses correctly, ambiguous parameter formats, expired authorization or a server error can prevent execution. Locate the stage that failed before deciding what to improve.
A strong web retriever can struggle to find tools
In 2025, researchers from Shandong University, Baidu and Leiden University combined 34 datasets to create ToolRet, a benchmark for retrieval across heterogeneous collections. It includes 7,615 retrieval tasks and 43,215 tools: 36,978 web APIs (85.6%), 3,794 program functions (8.8%) and 2,443 custom application tools (5.7%).
Models that scored well on conventional IR benchmarks lost ground on ToolRet. Some, including ColBERT, fell behind lexical BM25. With the original query alone and no added task instructions, every model scored below 52% Recall@10 and below 35% Completeness@10. For most tasks the top ten candidates did not contain all the required tools. When a workflow depends on several tools, one missing capability can halt it.
Why is retrieving tools harder than retrieving information?
Users describe the outcome they need
A search for “GA4 tutorial” shares words with the target page. “Find out why revenue has fallen” describes a business goal. On ToolRet the average query is 46.87 tokens long. API documentation instead lists endpoints, fields and arguments, averaging 174.56 tokens. The two may share very little wording.
The ToolRet team used ROUGE-L to measure lexical overlap between queries and retrieval targets.
The scores were 0.34 for MS MARCO, 0.31 for Natural Questions, 0.27 for MTEB and 0.11 for HotpotQA. ToolRet scored just 0.06. The retriever must infer which capabilities would achieve a goal. Marketers may recognize the Jobs-to-be-Done (JTBD) principle: a customer wants to accomplish something through a product. Retrieval connects that desired outcome to the functions a tool can actually perform.
A similar topic can hide a different function
Consider four marketing tools from the same company:
- Look up real-time website traffic.
- Look up Google Search impressions and clicks.
- Analyze paid advertising conversion rates.
- Forecast website traffic from historical data.
All four deal with traffic or marketing performance and may lie close together in vector space. To find out how many people visited yesterday, neither search impressions nor a traffic forecast can replace observed visits. Retrieval has to distinguish data sources, time windows, read and write permissions and functional scope. A model good at finding related articles can easily confuse relevance with suitability here.
One task can require several complementary tools
A conventional search question may need one article or a handful of sources. An AI agent often has to carry out a sequence across platforms. Diagnosing an ecommerce revenue drop may require orders, ad spend, traffic and conversion funnel data, followed by aggregation. One highly relevant tool may cover only part of that work.
Each ToolRet task has an average of 2.17 annotated target tools. Completeness@K tests whether the shortlist contains all of them. Qu and colleagues identified the same issue in COLT at CIKM 2024. Scoring similarity between a query and each tool description independently can retrieve near-duplicates while missing a complementary function. Nine relevant tools cannot make up for the only one capable of a required operation.
How does retrieval quality affect task success?
A retriever's output limits what the language model can do next. The ToolRet team tested this end to end on ToolBench-G1. It replaced the human-annotated reference (oracle) tools with candidates retrieved by bge-large-en-v1.5 and measured how often GPT-3.5 completed the task.
The pass rate fell from 62.0% to 50.6%, a drop of 11.4 percentage points. The team then fine-tuned the same retriever on ToolRet-train, which contains over 200,000 training tasks. On ToolBench-G1, NDCG@10 rose from 34.29 to 71.11, and GPT-3.5's pass rate recovered to 59.5%, close to the oracle result. Changing retrieval alone materially changed what the agent could accomplish.
From search rankings to tool recall: a new contest for visibility
Companies use SEO to gain organic search visibility, then rely on content, product pages and the website experience to convert visitors. With an AI agent, the user states a task, the agent retrieves and selects a service and an API performs the operation. The two paths can coexist, with different decision points to measure.
| Traditional search | AI agent |
|---|---|
| Web indexing | Tool indexing or registration |
| Search results impression | Candidate tool exposure |
| User clicks a result | Model selects a tool |
| User operates a website feature | Tool call |
| Website conversion | Task completion or transaction |
SaaS providers traditionally use content, search ads and free trials to bring people to their sites to compare plans and sign up. An agent integration can put the service to work before the user ever visits its homepage. Website traffic is only one measure of acquisition in that setting. Retrieval frequency, shortlist inclusion, calls and transactions completed through agents can also matter.
How tool retrieval relates to tool selection optimization
Tool retrieval asks how a system finds capabilities. LS-Labs approaches the same problem from the provider's perspective through TSO, or tool selection optimization: how can a service be discovered, selected appropriately and executed reliably? In the four-stage TSO framework of integration, candidate exposure, model selection, and calling and execution, retrieval primarily affects candidate exposure. Indexing and integration also matter, as does documentation that communicates the service's actual capabilities. Providers can work on three things.
Describe the tasks the tool can perform
“An all-in-one intelligent data solution” says little about a service's sources or operations. “Query GA4 traffic, acquisition sources, landing pages and conversion events, and compare performance across date ranges” names the source, dimensions and comparison capability. It gives both the retriever and the model something concrete to match.
A tool description is one of the first interfaces an agent has to your service. Specify accepted inputs, supported actions, returned data and operations outside its scope. Vague claims dilute those signals.
Connect features to real use cases
API documentation is often organized by feature or endpoint. Users ask about business goals. ToolRet's ROUGE-L scores illustrate that gap. Alongside field names, a tool description for comparing search impressions and clicks could mention investigating a decline in organic search traffic, comparing article performance or finding pages with rising impressions and few clicks.
These examples should connect everyday wording to the tool's real capabilities. Stuffing a tool description with unrelated keywords or unsupported scenarios may win shortlist exposure only to cause a selection or execution failure and undermine trust.
Measure retrieval performance
To test a change in a tool description, count more than final calls. With sufficiently complete logs you can measure candidate recall, model selection and execution outcomes separately.
| Metric | What it measures |
|---|---|
| Recall@K | Share of required tools present in the top K |
| Precision@K | Share of the top K candidates that are relevant |
| Completeness@K | Whether all required tools appear in the top K |
| nDCG@K | Whether relevant tools rank near the top |
| Task success rate | Whether the user's task was completed |
Low Recall@K points to initial retrieval: check indexed fields and task vocabulary. Good recall with low completeness suggests multi-tool tasks lack a crucial supporting tool. Low nDCG@K means relevant tools rank low and may miss a cutoff. If these scores hold up but task success remains poor, investigate selection, parameter schemas and API reliability. As with impressions, clicks and conversions in marketing, separate measures tell you where performance breaks down.
When AI uses a service, the website is only part of the product
From SEO to GEO (generative engine optimization), digital marketing has expanded from search results to AI-generated answers. As AI agents gain the ability to operate external services, companies face a further question: can an agent actually use the product it describes?
GEO asks whether a company appears in AI answers. TSO asks whether an agent can find, choose and use its tools. AX, or agent experience, asks whether the interaction allows the agent to complete the user's task. Designing sites and conversion paths for people now goes hand in hand with making a service's value, boundaries and interfaces clear to machines.
When users describe the outcome and delegate software choices, tool retrieval matters beyond engineering. It affects distribution, visibility and access to customers. As the agent economy develops, companies need to be findable by people and by AI systems handling the right task.
References
- Shi, Z., Wang, Y., Yan, L., Ren, P., Wang, S., Yin, D., & Ren, Z. (2025). Retrieval Models Aren't Tool-Savvy: Benchmarking Tool Retrieval for Large Language Models. Findings of ACL 2025. arXiv:2503.01763v2
- Qin, Y., et al. (2024). ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs. International Conference on Learning Representations (ICLR 2024). arXiv:2307.16789
- Qu, C., et al. (2024). Towards Completeness-Oriented Tool Retrieval for Large Language Models. Proceedings of the 33rd ACM International Conference on Information and Knowledge Management (CIKM 2024). arXiv:2405.16089






