MCP Tools Shouldn't Return Long Text
Street_Inevitable_77 · reddit · 2026-07-14
The author shares a key tweak from building an MCP server: making tools return only structured data instead of "nice human-readable summaries." They initially thought having tools write out answers would be more convenient, but it actually performed worse.
Main takeaways:
- Higher consistency: Without writing sentences, the model can freely organize its expression based on the user's prompt, rather than rigidly adopting the tool author's phrasing.
- Better composability: Returning numbers, fields, and status codes is ideal for subsequent steps; if long text is returned, the model has to "read" the English back into structured information anyway.
- Easier debugging: Structured outputs either fit the schema or they don't. Natural language might look fine, but that doesn't mean the model won't misinterpret it.
- Lower costs: Using prose to pass numbers is the biggest waste of tokens.
The author's principle: Tools should only return computed results; how to explain them to the user should be left to the model or client. The only real challenge is error messaging: pure error codes are too cold, while pure natural language drags prose back into the tool layer. Thus, they currently prefer "structured errors + machine-readable reasons," letting the model handle the narrative.
More from coding & agent
- A GLP1R variant may explain stronger Ozempic weight loss, and the team built an agent workflow — julia_kiseleva · 2026-07-21
- A Claude-coded Chrome extension shames you with a private jet when you open YouTube — alex_verem · 2026-07-21
- A curated TTS list for voice agents tracks latency, cancellation, and evals — mahimairaja · 2026-07-21
- Harness engineering is emerging as the execution layer for reliable AI agents — Pavan_Belagatti · 2026-07-21
- DevFest Lisbon keynote will cover Google AI Studio’s latest vibe coding and agentic AI features — gerardsans · 2026-07-21
- Daniel Hanchen’s 2-hour workshop covers open models, reward hacking and RL — danielhanchen · 2026-07-21