Semantic Tool Discovery for Large Language Models: A Vector-Based Approach to MCP Tool Selection
This paper introduces a vector-based semantic tool discovery architecture for the Model Context Protocol (MCP) that significantly reduces token overhead and latency by dynamically selecting only the most relevant tools via dense embeddings, achieving a 99.6% reduction in token consumption while maintaining a 97.1% hit rate.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a brilliant but slightly overwhelmed personal assistant (the Large Language Model or LLM). You are incredibly smart at writing, coding, and solving problems, but you can't physically pick up a phone, check a database, or look at a file on your own. You need tools to do those things.
In the past, to help you, your boss (the system) would hand you a giant, dusty encyclopedia containing every single tool they own—maybe 100, 200, or even 1,000 different ones. They would say, "Here is the whole list. Figure out which one you need for this job."
The Problem: The "Library of Everything"
This approach has three big flaws:
- It's too expensive: Reading the descriptions of 1,000 tools takes up a massive amount of "mental space" (tokens), which costs real money.
- It's confusing: When you are staring at 1,000 options, you get "analysis paralysis." You might pick the wrong one because you're overwhelmed.
- It's slow: You spend more time reading the list than actually doing the work.
The Solution: The "Smart Librarian"
This paper proposes a new way to work. Instead of handing you the whole encyclopedia, they install a Smart Librarian (the Vector-Based Discovery System) between you and the tools.
Here is how the new system works, step-by-step:
1. The Tool Index (The Library Catalog)
First, the system takes all those 100+ tools and writes a short, friendly summary for each one. It turns these summaries into a unique "fingerprint" (a vector embedding) that captures the meaning of the tool, not just the words.
- Analogy: Imagine every tool is a book. Instead of just looking at the title, the librarian reads the whole book and gives it a specific color code based on its vibe. "File Deleter" gets a "Red" code; "Weather Checker" gets a "Blue" code.
2. The User Query (Asking for Help)
When you ask a question like, "I need to delete that old report," the system doesn't just look for the word "delete." It turns your sentence into a matching "fingerprint."
- Analogy: You tell the librarian, "I need a Red book." The librarian instantly knows what you mean, even if you said "get rid of" instead of "delete."
3. The Magic Match (Vector Search)
The librarian looks at their color-coded list and instantly finds the 3 to 5 tools that match your fingerprint best.
- The Result: Instead of handing you 100 books, the librarian hands you a tiny stack of 3 perfectly relevant books.
Why This is a Game-Changer
The paper tested this with 121 different tools (like checking files, looking up weather, or managing GitHub projects) and 140 different questions. Here is what they found:
- Massive Savings (The Wallet): By only showing the LLM 3 tools instead of 121, they cut the "reading cost" by 99.6%.
- Real-world impact: If a company was spending $1.5 million a year on "reading the tool list," this method drops that cost to almost nothing.
- Smarter Choices (The Brain): The LLM made fewer mistakes. When you give a genius a tiny, perfect list, they perform better than when you give them a giant, messy list. The system found the right tool 97% of the time just by showing the top 3 options.
- Super Fast (The Speed): The librarian did the matching in less than 100 milliseconds. That's faster than a human blinking. It adds almost no delay to the conversation.
The "File System" Challenge
The paper also noted that some tools are harder to distinguish than others.
- Easy: "Check the weather" vs. "Check GitHub." These are very different. The librarian finds them instantly.
- Hard: "Read a file," "Write a file," "Copy a file," "Move a file." These all sound very similar. The librarian sometimes has to show a few more options (like 5 instead of 3) to make sure the LLM picks the right one.
The Bottom Line
This paper introduces a filter for AI tools. Instead of drowning the AI in a sea of options, it acts as a smart gatekeeper, only letting the most relevant tools through the door.
In simple terms: It turns a chaotic, expensive, and confusing "all-you-can-eat buffet" of tools into a curated, 3-course meal that is cheaper, faster, and tastes much better. This makes it possible for companies to use AI with hundreds of tools without going broke or getting confused.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.