Best for · AI tools
Tool discovery for AI agents: how agents find the right tool, and the options that do it
- Last checked
- 7 sources, linked below
- By the vectaai team
We read every plan page. Paid links are labelled. Money never changes a ranking. How we pick.
Verdict Our pick
The bar guide has a call.

- Tool discovery is how an AI agent finds and loads the tools it needs for a step, instead of stuffing every tool definition into its context up front.
Compared here
- 01MCP tools/list
- 02Anthropic tool search tool
- 03Claude Code MCP tool search
- 04Official MCP Registry
- 05Custom search over your own catalog
Short answer
Tool discovery is how an AI agent finds and loads the tools it needs for a step, instead of stuffing every tool definition into its context up front. It matters once you have more than a few dozen tools: Anthropic's docs say a typical setup with GitHub, Slack, Sentry, Grafana and Splunk servers can eat about 55,000 tokens in tool definitions before the agent does any work, and tool search "typically reduces this by over 85 percent" by loading only the 3 to 5 tools a request needs.
There are two layers. Inside one agent, use protocol listing (MCP's tools/list) for small sets and a search step (Anthropic's tool search tool, or Claude Code's built-in MCP tool search) for big ones. Across the ecosystem, the official MCP Registry (in preview) lists public MCP servers with DNS-verified names, for marketplaces and clients to build on. Finding a tool must never mean being allowed to call it: keep permission checks at call time.
At a glance
| Approach | Layer | How it finds tools | Good for | Watch out for |
|---|---|---|---|---|
| MCP tools/list | One agent, per server | Client asks each server for its tools; servers can send list_changed notifications | Under a few dozen tools | Every definition costs context |
| Anthropic tool search tool | One agent, API | Claude searches deferred tools by regex or BM25; API returns up to 5 matches by default | Hundreds or thousands of tools | You still send every definition in each request |
| Claude Code MCP tool search | One agent, CLI | On by default; MCP tools load on demand through a ToolSearch step | Many MCP servers on one machine | Can be switched off; some gateways need setup |
| Official MCP Registry | Ecosystem | REST API of public MCP server metadata with DNS-verified namespaces | Marketplaces, aggregators, private registries copying the API | Preview; public servers only; not meant to be called by host apps directly |
| Custom search over your own catalog | One agent or platform | Your own embeddings, keywords or hybrid search | Internal tools, strict control | You own index quality and logging |
Give an AI agent three tools and it picks the right one. Give it three hundred and it starts acting like a guy in a hardware store who walked in for one screw: overwhelmed, slow, and coming home with the wrong thing. Tool discovery is the fix. Instead of handing the agent the whole catalog, you let it search for what it needs, load that, and get on with the job.
The honest bit: this page explains the idea and the main official options, from the MCP specification, the MCP Registry docs, and Anthropic's API and Claude Code docs, all read on 3 December 2026. We did not benchmark discovery methods. No product here pays us.
What tool discovery means
A "tool" is anything an agent can call: search the web, query a database, open a GitHub issue, send a Slack message. Each one comes with a definition: a name, a description and an input schema. The model reads those definitions to decide what to call.
The naive way is to put every definition in the prompt, every time. That works fine for a handful of tools. It breaks in two ways as the list grows, and Anthropic's tool search docs name both:
- Context bloat. "A typical multiserver setup (GitHub, Slack, Sentry, Grafana, and Splunk) can consume ~55k tokens in definitions before Claude does any work." You pay for those tokens on every call, and they crowd out the actual task.
- Worse tool choice. The model's ability to pick the right tool "degrades" as the list grows, especially when many tools have similar descriptions.
Discovery swaps "here is everything" for "search, then load". The agent sees a small base set plus a search tool, and pulls in specific tools only when a step needs them.
When you need it, and when you do not
Arize's glossary entry puts it well: loading the full catalog "is simpler. There is no search step, no discovery failure, and context cost is predictable. It works well below a few dozen tools." Discovery wins "when the catalog is large or rarely used in full". The common middle ground: pin the tools you use constantly, and discover the long tail.
| Your setup | Do this |
|---|---|
| Under about 20 to 30 tools | Load them all. Keep descriptions sharp. |
| A few dozen to a hundred, a few used often | Pin the frequent ones, defer the rest behind search |
| Hundreds or thousands across many servers | Search-based discovery, plus logging of what loaded |
| Picking which servers to install at all | A registry or marketplace, then human review |
Layer 1: discovery inside one agent
MCP's built-in listing
The Model Context Protocol spec gives the basic mechanism. A client asks a server for its tools with a tools/list request, which supports pagination. Servers that support tools declare a tools capability, and if they set listChanged: true they "SHOULD" send a notifications/tools/list_changed message when the list changes. That is discovery in its simplest form: ask, get the list, get told when it changes.
The same spec page carries safety advice for clients that is worth repeating: show users which tools are exposed to the model, make it obvious when tools are invoked, and present confirmation prompts "to ensure a human is in the loop".
What tools/list does not do is decide which tools are relevant to this request. Connect ten servers and the client still gets every tool from every server. That is the gap search fills.
Anthropic's tool search tool (API)
For builders on the Claude API, the tool search tool is the official version of "search, then load". From Anthropic's docs:
- You add a tool search tool to your tools list. Two variants: regex (
tool_search_tool_regex_20251119, Claude writes Pythonre.search()patterns, max 200 characters) and BM25 (tool_search_tool_bm25_20251119, Claude writes natural language queries, max 500 characters). - You send every tool definition, marking the ones that should not load up front with
defer_loading: true. At least one tool, normally the search tool, must stay loaded. - When Claude needs something, it searches. The API returns matches as
tool_referenceblocks, "up to 5 by default", and expands them into full definitions. - Claude picks from what it found and calls it.
Anthropic says this "typically reduces" definition tokens "by over 85 percent, loading only the 3 to 5 tools Claude needs for a given request". The search covers tool names, descriptions, argument names and argument descriptions, so good descriptions are now a search ranking problem as well as a prompting one.
Two practical notes from the same page. First, defer_loading controls what enters the context, not what you send: you still send every full definition in every request, because the API needs them to search. Second, if the server-side search does not fit, you can build your own client-side tool search; Anthropic documents that route too. Current models listed for both variants include Claude Fable 5.2, Opus 5.5 and Sonnet 5.5. If you are choosing a model for an agent, our Claude Opus vs Sonnet vs Haiku page covers price and fit.
Claude Code: tool search on by default
If you use Claude Code rather than the raw API, you get discovery without writing any of this. The Claude Code MCP docs describe tool search as the default path: tools from connected MCP servers are deferred and found through a ToolSearch step. The docs list knobs for it: an ENABLE_TOOL_SEARCH setting (with an auto threshold below which tools stay loaded), marking a tool to load up front or stay deferred, exempting a server from deferral, description length limits, and extra setup when you route through an LLM gateway. If a needed server is still connecting, Claude waits inside the ToolSearch call.
The upshot for a normal user: you can connect more MCP servers than you used to without the context filling up with definitions you never use.
Layer 2: discovery across the ecosystem
The other meaning of "tool discovery" is bigger: how does anyone find which MCP servers exist at all?
The official MCP Registry
The MCP Registry docs describe it as "the official centralized metadata repository for publicly accessible MCP servers, backed by major trusted contributors to the MCP ecosystem such as Anthropic, GitHub, PulseMCP, and Microsoft." Key facts from that page:
- It is in preview. "Breaking changes or data resets may occur before general availability."
- It stores metadata, not code. Each server has a
server.jsonwith its unique name, where to get it (an npm package or a remote URL, for example), how to run it, and discovery details like description and capabilities. The code itself lives on npm, PyPI, Docker Hub and the like. - Names are verified. Server names use reverse DNS, like
io.github.username/server, tied to verified GitHub accounts or domains, so "only the legitimate owner of a GitHub account or domain can publish servers under that namespace." - It is public only. Private servers on internal networks or private package registries are not supported. The docs suggest running your own private registry.
- It is built for aggregators. The metadata is "deliberately unopinionated", meant to be pulled by marketplaces that add curation and ratings, roughly hourly. Host applications are told not to call it directly, but to use registries that implement its OpenAPI spec.
- Security scanning is delegated to the underlying package registries and to downstream aggregators.
You can browse it at registry.modelcontextprotocol.io.
Marketplaces and private registries
Because the official registry is a raw feed, most people will discover servers through a marketplace built on top of it, or a company's own private registry that implements the same API. If you run a team, the private registry route is the one to think about: it lets you publish only vetted servers, internal ones included, and point every developer's client at that list.
Discovery is a security decision
This is the part people skip. Discovery decides what the agent can see. It does not decide what the agent is allowed to do. Arize's glossary is blunt: "Finding a tool must never imply being allowed to call it. Authorization checks belong at call time."
Three practical rules:
- Trust the source before the description. A tool's description is written by whoever published it. A bad actor can write a very attractive one. Verified namespaces, like the MCP Registry's, help; human review before install helps more.
- Log what loaded. With discovery, "the loaded tool set changes from run to run", so record it, or you cannot reproduce or audit what happened.
- Keep a human on risky actions. The MCP spec recommends confirmation prompts. Use them for anything that writes, deletes, spends or sends.
These line up with the OWASP Top 10 for LLM apps, where prompt injection and excessive agency sit near the top. For products that police agents, tools and MCP servers across a company, see our AI coding agent security platforms roundup.
Common failure modes
- Bad descriptions. If the search cannot find the right tool, it is usually an index problem, not a model problem. Write descriptions with the words a user would actually type.
- Exact names missed. Arize notes embedding search can miss exact identifiers and error codes that keyword search catches. Anthropic's regex variant helps here; hybrid search or pinning critical tools also works.
- Stale lists. If a server changes its tools and does not send
list_changed, clients may work from an old list. - Over-pinning. Pinning 60 "important" tools brings back the bloat you were escaping.
Which approach to pick
- Hobby agent with a few tools: list them all. Done.
- Claude Code user with lots of MCP servers: leave the default tool search on; pin the two or three tools you use constantly.
- Building on the Claude API with a large catalog: the tool search tool with
defer_loading, BM25 for natural language, regex if your tool names follow patterns. - Company rolling out agents: a private registry of vetted servers, call-time authorization, and logs of which tools loaded on each run.
For picking the agent itself, see Claude Code vs Antigravity and best AI model for coding.
The bottom line
Tool discovery is just good manners for agents: do not dump the whole toolbox on the table, hand over the right three tools. Under a few dozen tools you do not need it. Past that, use the search that comes with your stack, keep descriptions sharp, verify where servers come from, and never let "found it" stand in for "allowed to use it".
Questions people ask
What is tool discovery in AI agents?
It is the step where an agent looks up which tools exist and loads only the ones it needs, instead of receiving every tool definition at the start. In MCP, clients call tools/list on each server. At scale, agents search a catalog, like Anthropic's tool search tool, which returns a few matching tools for the model to use.
When do I need tool search instead of listing every tool?
When the list gets long. Loading every tool is simpler and predictable, and works well below a few dozen tools. Past that, definitions eat context and the model picks the wrong tool more often. Anthropic's docs say tool search typically loads just 3 to 5 tools per request and cuts definition tokens by over 85 percent.
What is the MCP Registry?
The official, centralized metadata repository for publicly accessible MCP servers, backed by contributors including Anthropic, GitHub, PulseMCP and Microsoft. It is in preview. It stores a server.json per server, uses reverse DNS names verified against GitHub accounts or domains, and offers a REST API that marketplaces and aggregators consume. It does not host private servers.
Is tool discovery a security risk?
It can be. Discovery decides what the agent sees, not what it may do, so authorization must still happen when a tool is called. A malicious server can also describe itself attractively. Use verified namespaces, review servers before install, log which tools loaded on each run, and keep human confirmation for risky actions, as the MCP spec recommends.
How does Claude Code handle many MCP servers?
Claude Code's MCP docs describe tool search as the default: tools from connected servers are deferred and found through a ToolSearch step when needed. You can change the behaviour with the ENABLE_TOOL_SEARCH setting, mark tools to load up front, or exempt a server from deferral. Gateways may need extra configuration.
Sources
Every fact above comes from these pages. Prices change, so each one carries the date we read it.
- Model Context Protocol specification: Tools (2025-11-25), checked 3 Dec 2026
- Model Context Protocol: The MCP Registry, checked 3 Dec 2026
- Official MCP Registry, checked 3 Dec 2026
- Claude Platform Docs: Tool search tool, checked 3 Dec 2026
- Claude Code docs: Connect Claude Code to tools via MCP, checked 3 Dec 2026
- Arize glossary: What is tool discovery?, checked 3 Dec 2026
- OWASP Top 10 for LLM applications, checked 3 Dec 2026