RAG-MCP: Retrieve the Right Tools Instead of Dumping Them All In
- Source
- writer.com
- Publisher
- Writer
- Author
- WRITER
- Date

Context
RAG- is a way to stop an agent's tool list from crowding out its thinking. In WRITER's walkthrough, the problem is what the post calls rot: when the description of every available tool is pasted into the prompt, the model's reasoning can degrade and similar tools start to blur together. RAG-MCP puts a search step in front of the model instead. Tool descriptions are stored as , numeric representations that let text be compared by meaning; each request is compared against them, the closest matches are ranked, and only those are placed in the prompt for the model to choose from.
The headline figures, three times better tool accuracy and more than 50% fewer tokens, come from a separate research paper by Tiantian Gan and Qiyao Sun, not from WRITER's own testing. The authors report that on web-search tasks, with Qwen-max as the model, retrieval picked the correct tool 43.13% of the time, against 13.62% when every description was supplied at once and 18.20% with simple keyword filtering, while average prompt size fell from about 2,134 tokens to 1,084, roughly half. Tripling therefore means going from roughly one correct pick in seven to under half. The paper's own stress test also found that retrieval precision drops as the pool of candidate tools grows very large, and its authors name better retrieval at extreme scale as future work.
WRITER's prototype is a smaller illustration of the idea rather than a reproduction of that experiment. It fetches tools from an , embeds each tool's name and description with an open sentence-transformers model, and builds a prompt containing the top three matches with their similarity scores; the paper's method injects only the single best match, optionally after a test call to check it works. The prototype stops before the model is called. The post frames this as the context-engineering companion to WRITER's MCP gateway, which already uses vector-based retrieval to distill hundreds of API endpoints into a small set of tools for its agents.
- Model Context Protocol (MCP) — A published agreement for an AI application to discover what a separate program offers and ask it to run one of those offerings.
- Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
- embedding — A list of numbers representing a piece of text's meaning, so that similar meanings end up numerically close and can be searched.
- MCP server — A program that provides tools, resources and prompt templates to an MCP client; it may run on the same machine as the application or remotely.
articleCollapsing hundreds of API endpoints into two MCP toolsWRITER
articleCartograph: Federated Tool Discovery with Operator-Attested Retrieval for AI AgentsJustice Owusu Agyemang, Michael Agyare, Kwame Opuni-Boachie Obour Agyekum, Kwame Agyeman-Prempeh Agyekum, Francisca Adoma Acheampong, Jerry John Kponyo
videoStop babysitting your agents... — Brandon Waselnuk, UnblockedAI Engineer


