<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-complete-guide-to-tool-selection-in-ai-agents-nnbhdagkm" -->

---
title: The Complete Guide to Tool Selection in AI Agents
description: Agent accuracy degrades measurably as tool catalogs grow past 10–15 tools due to context crowding, the &#x27;lost in the middle&#x27; effect, and tool hallucination. Six...
canonical: https://daily.dev/posts/the-complete-guide-to-tool-selection-in-ai-agents-nnbhdagkm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Complete Guide to Tool Selection in AI Agents | daily.dev
og:description: Agent accuracy degrades measurably as tool catalogs grow past 10–15 tools due to context crowding, the &#x27;lost in the middle&#x27; effect, and tool hallucination. Six...
og:url: https://daily.dev/posts/the-complete-guide-to-tool-selection-in-ai-agents-nnbhdagkm
og:image: https://api.daily.dev/og/posts/nnBHDAGkm.png
og:image:alt: The Complete Guide to Tool Selection in AI Agents
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.

# The Complete Guide to Tool Selection in AI Agents

**[Machine Learning Mastery](https://daily.dev/sources/mlm)** · 9 min read · 1 upvotes · 0 comments

## Summary

Agent accuracy degrades measurably as tool catalogs grow past 10–15 tools due to context crowding, the 'lost in the middle' effect, and tool hallucination. Six layered techniques address this: gating (cheap classifier to skip tool calls on conversational turns), retrieval-based selection (vector-index tool descriptions and send only top-K relevant tools per query), semantic routing (classify queries into tool categories), planner-based selection (generate a structured multi-step plan and scope tools per step), fallback logic (tiered confidence-based retry and clarification escalation), and benchmarking (labeled query/tool pairs to measure accuracy, token cost, and latency). The RAG-MCP paper provides hard evidence: retrieval-filtered selection tripled accuracy from 13.62% to 43.13% while cutting prompt tokens by over 50%. None of these techniques require a larger model — they require treating the tool list as something to be designed rather than appended.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://machinelearningmastery.com/the-complete-guide-to-tool-selection-in-ai-agents>

## Questions this post answers

### why does an AI agent's accuracy drop as I add more tools to it

Every tool's name, description, and parameter schema gets sent to the model on every request, so with 50-plus tools this can consume 5 to 7% of the context window before the user's message even arrives. This crowds out reasoning space and triggers the 'lost in the middle' effect, plus tool hallucination, where the model invents nonexistent tool names or borrows arguments from the wrong tool's schema. Production benchmarks show accuracy dropping noticeably once tool counts pass roughly 15 to 20.

_Anyone scaling an agent's toolset can track proven fixes for tool selection failures on daily.dev._

### how much does retrieval-based tool selection improve accuracy compared to exposing the full tool catalog

Retrieval-based tool selection more than tripled tool selection accuracy, from 13.62% with the full catalog exposed to 43.13% with retrieval-filtered selection, according to the RAG-MCP paper published in May 2025. It also cut prompt tokens by over 50% on the same benchmark tasks, by indexing tool descriptions in a vector store and sending only the top-K most relevant tools to the model per query.

_Developers weighing retrieval strategies for agent tooling can follow benchmarked results like this on daily.dev._

### what is the maximum number of tools an AI agent can use with OpenAI's API

OpenAI documents a hard ceiling of 128 tools per agent, but real accuracy degradation shows up well before that limit. Most production teams see noticeable accuracy drops once they cross 15 to 20 tools in active rotation, making techniques like gating, retrieval, and routing necessary long before hitting the technical maximum.

_Teams designing multi-tool agents can compare real-world limits versus documented caps on daily.dev._

## Similar posts on daily.dev

- [Your Agent Isn't Dumb. Your Tools Are.](https://daily.dev/posts/your-agent-isn-t-dumb-your-tools-are--grledaace) · The T-Shaped Dev · 3 upvotes · 2 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#ai-agents](https://daily.dev/tags/ai-agents), [#mcp](https://daily.dev/tags/mcp), [#rag](https://daily.dev/tags/rag)

[View this post on daily.dev](https://daily.dev/posts/the-complete-guide-to-tool-selection-in-ai-agents-nnbhdagkm)

```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":"The Complete Guide to Tool Selection in AI Agents","url":"https://daily.dev/posts/the-complete-guide-to-tool-selection-in-ai-agents-nnbhdagkm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-complete-guide-to-tool-selection-in-ai-agents-nnbhdagkm"},"datePublished":"2026-07-06T12:09:45.334Z","dateModified":"2026-09-14T08:51:06.761Z","description":"Agent accuracy degrades measurably as tool catalogs grow past 10–15 tools due to context crowding, the 'lost in the middle' effect, and tool hallucination. Six...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/174166ce558edc76b76d618b219283f8?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/174166ce558edc76b76d618b219283f8?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Machine Learning Mastery","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":"Machine Learning Mastery","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/795781ffb32446c39eba040feb64f505","url":"https://daily.dev/sources/mlm"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-complete-guide-to-tool-selection-in-ai-agents-nnbhdagkm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,ai-agents,mcp,rag","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Machine Learning Mastery","item":"https://daily.dev/sources/mlm"},{"@type":"ListItem","position":3,"name":"The Complete Guide to Tool Selection in AI Agents"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-complete-guide-to-tool-selection-in-ai-agents-nnbhdagkm#faq","mainEntity":[{"@type":"Question","name":"why does an AI agent's accuracy drop as I add more tools to it","acceptedAnswer":{"@type":"Answer","text":"Every tool's name, description, and parameter schema gets sent to the model on every request, so with 50-plus tools this can consume 5 to 7% of the context window before the user's message even arrives. This crowds out reasoning space and triggers the 'lost in the middle' effect, plus tool hallucination, where the model invents nonexistent tool names or borrows arguments from the wrong tool's schema. Production benchmarks show accuracy dropping noticeably once tool counts pass roughly 15 to 20. Anyone scaling an agent's toolset can track proven fixes for tool selection failures on daily.dev."}},{"@type":"Question","name":"how much does retrieval-based tool selection improve accuracy compared to exposing the full tool catalog","acceptedAnswer":{"@type":"Answer","text":"Retrieval-based tool selection more than tripled tool selection accuracy, from 13.62% with the full catalog exposed to 43.13% with retrieval-filtered selection, according to the RAG-MCP paper published in May 2025. It also cut prompt tokens by over 50% on the same benchmark tasks, by indexing tool descriptions in a vector store and sending only the top-K most relevant tools to the model per query. Developers weighing retrieval strategies for agent tooling can follow benchmarked results like this on daily.dev."}},{"@type":"Question","name":"what is the maximum number of tools an AI agent can use with OpenAI's API","acceptedAnswer":{"@type":"Answer","text":"OpenAI documents a hard ceiling of 128 tools per agent, but real accuracy degradation shows up well before that limit. Most production teams see noticeable accuracy drops once they cross 15 to 20 tools in active rotation, making techniques like gating, retrieval, and routing necessary long before hitting the technical maximum. Teams designing multi-tool agents can compare real-world limits versus documented caps on daily.dev."}}]}
```

