Hacker News new | ask | show | jobs
by ok_dad 16 days ago
I like MCP, but most servers and harnesses just dump all of the tools into context each message. Also the default tutorials for everything around MCP say to dump tools this way.

It’s really hard to determine which tools an agent will need on the fly. The best idea I’ve seen was to do a “search tools” tool which an agent would use to find relevant tools, then have an “execute tool” tool which did what it says.

Alternatively, if you’re using an agent that’s good with code, give it something like “port of context” (pctx) which translates MCP tools into a JavaScript package so the agent can chain MCP tools together with code, and they can filter the data down to just what they need. I haven’t used this method much yet but soon I need to improve the MCP gateway in our cloud agent builder product so I’m going to try this one out soon myself.

1 comments

Agreed 100%. It's sad when the harness floods the context with a whole MCP response and then see the model dumping everything to disk to process it with a script. That's something the harness should do whenever the result is large: dump the json into a file and just say to the model: "your data is in /tmp/foo.json, it's very large so be careful with it", but I don't remember having ever seen that; maybe some harnesses do it? Depending on what the model is after it might want to filter for this or that, no need to load everything in the context.
That’s a good idea too, I might steal it.