1️⃣ Dynamic MCP Tool Filtering using Embedding & 2️⃣ Confident tool calls with BAML #2893
Replies: 17 comments 8 replies
-
Here is what I propose for the MCP specification update to facilitate dynamic tool discovery. Please support the idea here |
Beta Was this translation helpful? Give feedback.
-
Another elegant solution would be to allow MCP Clients to utilize the |
Beta Was this translation helpful? Give feedback.
-
Here is a paper that may be relevant |
Beta Was this translation helpful? Give feedback.
-
I think this is relevant. Addressing LLMs limitations in generating sophisticated long-form outputs. Survey analysis of over 1400 research papers:
https://github.com/Meirtz/Awesome-Context-Engineering |
Beta Was this translation helpful? Give feedback.
-
I believe that MCP Client should be able to do RAG with MCP to improve quality and scalability. |
Beta Was this translation helpful? Give feedback.
-
related #5963 |
Beta Was this translation helpful? Give feedback.
-
Context Rot Affects LLM Performance Longer input does not guarantee consistent results 🔍 Chroma researchers tested 18 LLMs on simple tasks
Research results https://github.com/chroma-core/context-rot ![]() |
Beta Was this translation helpful? Give feedback.
-
TypeScript Implementation of MCP Tool Semantic Search |
Beta Was this translation helpful? Give feedback.
-
Reranker with graphs |
Beta Was this translation helpful? Give feedback.
-
Suggested Embedding model: Codestral-Embed from mistral and Mxbai-rerank-v2 to improve performance for, code, MCP, and tool retrieval. |
Beta Was this translation helpful? Give feedback.
-
Suggested Embedded (In-Progress) VectorDBs: https://github.com/tursodatabase/turso |
Beta Was this translation helpful? Give feedback.
-
A few recent papers supporting the idea of RAG and semantic search for MCP Tools: Both papersconducted experiments demonstrating that both RAG techniques decrease the amount of consumed tokens while at the same time increasing task compleatenes score with Vector Search + Reranker. We basically improve quality and making it cheaper.
![]() ![]() ![]() |
Beta Was this translation helpful? Give feedback.
-
Would appreciate if you vote for this improvement idea to standardize MCP Specification with Delegated Advanced Tool Search in my comment feature here. |
Beta Was this translation helpful? Give feedback.
-
@qdrddr how is this any different? Could you get Dosu to get the most popular routing options, and see what the feature differences are? #6289 (comment) |
Beta Was this translation helpful? Give feedback.
-
MCP-use implemented a tool semantic search mechanism |
Beta Was this translation helpful? Give feedback.
-
MCP-Agent with EmbeddingRouter for semantic tool search and filtering. |
Beta Was this translation helpful? Give feedback.
-
MCP-Universe: Benchmarking Large Language Models with Key findings: Token count increases rapidly with interaction steps, often leading to context overflow and degraded performance in multi-step tasks requiring extensive reasoning.” This proves how MCP tool pre-filtering (prior LLM) is important, and as I was saying, especially manifests in multi-steps. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team 👋
First, thank you for the amazing work you're doing, Roo-Code! I've been diving into this ecosystem and wanted to propose a feature that I think would benefit a lot of developers working with large toolchains across multiple MCP servers.
🤖 The Problem
In the LLM-based Cline environment, we've seen that the reliability of tool usage drops significantly once the number of available tools exceeds ~20. This is a known issue: LLMs struggle to reason effectively when presented with too many tool options.
Now consider a real-world setup:
Currently, users are forced to manually disable MCP servers just to stay under the tool limit. It’s not scalable, and it limits the utility of what MCP can offer.
🎯 The Opportunity with Embeddings
Embedding filtering could be an ideal 1/2 solution to this scaling problem. Imagine dynamically filtering tools using semantic similarity between:
By narrowing the tool list down to the most relevant 20 (or a configurable limit), you:
✅ Keep the toolset within the LLM comfort zone
✅ Increase the accuracy of tool selection and calls
✅ Avoid manual management of tool/server lists
For example, if a user enters:
"Commit all my modified files and log their last modified timestamps before pushing to GitHub."
—Then only 2-3 tools from 2-3 MCP servers should be selected dynamically. There's no need to expose the full universe of 30+ tools.
This would allow MCP to scale elegantly even as more servers and tools come online. Ideally, this would support dynamic registration/deregistration of MCP servers and on-the-fly tool filtering
2️⃣ Execute tool calls more reliably with BAML
The second important part of the solution is to confidently call tools. We can enjoy the reliability of tool calls thanks to BAML capabilities (similar to Pydantic) to confidently populate all the required fields and parameters for the tool being called.
💡 Proposed Enhancements:
📚 References
BAML with MCP tools – example notebook
Large-scale classification with BAML
hello.py – example with Embeddings filtering
pick_best_category.baml
Would love to hear your thoughts on this! It could make the toolchain smarter, lighter, and way more user-friendly.
Thanks so much 🙏
Damein
Beta Was this translation helpful? Give feedback.
All reactions