Remix.run Logo
▲ jonathanlydall 2 hours ago

A “flaw” (if you will) of MCP is that some developers with a REST api background naively think it is similar and add tools for each discrete thing to be done. They also tend to put guidance for the LLMs in the description of each tool.

Now a Claude/Codex/etc user installs a few MCP servers and before they know it their context is already largely used up with tool schemas and guidance before they’ve sent their first prompt.

In response to this harnesses aggressively “hide” most of this to agents, so the agents land up doing best guesses on how to use tools, doing things like sending wrong argument names, etc.

Turns out that a really effective strategy to deal with this is to make two tools only, one to execute a script (eg in JS) and another on how to get guidance on how to craft a script.

When an agent needs to use the tool, they look at the “help” and then craft JavaScript (something they’re already very good at). If the execute endpoint returns adequately descriptive errors with stack traces then the agent can pretty much always self fix their mistake.

We worked this out for ourselves in our own product and we found out after that Cloudflare wrote a blog post on how they use the same strategy.