Collapsing hundreds of API endpoints into two MCP tools
- Source
- writer.com
- Publisher
- Writer
- Author
- WRITER
- Date

Context
WRITER is designing its gateway so that an agent sees two tools instead of hundreds: one that searches for the right tool and one that runs it. MCP (Model Context Protocol) is a standard way to connect AI agents to outside services. In the engineering article, Dennis Thompson explains the problem the two tools are meant to solve. Listing around 100 connectors, plus hundreds of tools from the selected ones, on every request fills the model's , slows its response and, he writes, lowers the chance that it picks the best tool for the job.
The gateway still holds every endpoint; it changes what the agent has to read. A pipeline builds tool definitions automatically from OpenAPI v3 specifications and Postman collections, or from online documentation scraped by an agent when no specification exists. WRITER's Palmyra X5 model then rewrites each description, because documentation is written for human developers rather than for a model deciding which tool to call. When the agent needs something, it describes the task in plain language. The search tool ranks tools by cosine similarity, a measure of how close the request's meaning is to each description, and returns the best matches for the agent to run through the second tool.
Thompson presents the two-tool design as a target, saying WRITER hopes to go further than a talk he saw that reduced Square's 200-plus payment endpoints to three layered tools. The article reports no accuracy or speed measurements for WRITER's own gateway. The research it links on tool-calling accuracy supports the premise in a narrower setting: in a study of small models on edge hardware, a compressed 8-billion-parameter Llama model given a benchmark's 46 tools chose the wrong one, then completed the same query when given 19. That study also narrowed tools by similarity search and reports execution time cut by up to 70%. It shows that fewer, more relevant choices can help a model, not that WRITER's gateway achieves the same. A later WRITER post on RAG-MCP builds on Thompson's article and describes the same retrieve-then-select approach in more detail.
- 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.
- API — Application programming interface: the agreed set of operations, inputs and outputs through which one piece of software uses another.
- RAG — Retrieval-augmented generation — fetching relevant documents first and pasting them into the model's context so it answers from your data instead of memory.





