Better HN
topnewbestaskshowjobs
Log inSign up

menix

17 karma · joined Jan 10, 2017 (9y ago) · 9 submissions

Submissions

comment 8mo ago · link · parent

One aspect I think is often overlooked in the CLI vs. MCP debate: MCP's support for structured output and output schema (introduced in the 2025-06-18 spec). This is a genuinely underrated feature that has practical implications far beyond just "schema bloat."

Why? Because when you pair output schema with CodeAct agents (agents that reason and act by writing executable code rather than natural language, like smolagents by Hugging Face), you solve some of the most painful problems in agentic tool use:

1. Context window waste: Without output schema, agents have to call a tool, dump the raw output (often massive JSON blobs) into the context window, inspect it, and only then write code to handle it. That "print-and-inspect" pattern burns tokens and attention on data the agent shouldn't need to explore in the first place.

2. Roundtrip overhead: Writing large payloads back into tools has the same problem in reverse. Structured schemas on both input and output let the agent plan a precise, single-step program instead of fumbling through multiple exploratory turns.

There's a blog post on Hugging Face that demonstrates this concretely using smolagents: https://huggingface.co/blog/llchahn/ai-agents-output-schema

And the industry is clearly converging on this pattern. Cloudflare built their "Code Mode" around the same idea (https://blog.cloudflare.com/code-mode/), converting MCP tools into a TypeScript API and having the LLM write code against it rather than calling tools directly. Their core finding: LLMs are better at writing code to call MCP than at calling MCP directly. Anthropic followed with "Programmatic tool calling" (https://www.anthropic.com/engineering/code-execution-with-mc..., https://platform.claude.com/docs/en/agents-and-tools/tool-us...), where Claude writes Python code that calls tools inside a code execution container. Tool results from programmatic calls are not added to Claude's context window, only the final code output is. They report up to 98.7% token savings in some workflows.

So the point here is: MCP isn't just valuable for the centralization, auth, and telemetry story the author laid out (which I fully agree with). The protocol itself, specifically its structured schema capabilities, directly enables more efficient and reliable agentic workflows. That's a concrete technical advantage that CLIs simply don't offer, and it's one more reason MCP will stick around.

Long live MCP indeed.

comment 1y ago · link · parent

smolagents by Hugging Face tackles your issues with MCP tools. They added support for the output schema and structured output provided by the latest MCP spec. This way print and inspect is no longer necessary. https://huggingface.co/blog/llchahn/ai-agents-output-schema

comment 1y ago · link · parent

The latest MCP specifications (2025-06-18+) introduced crucial enhancements like support for Structured Content and the Output Schema.

Smolagents makes use of this and handles tool output as objects (e.g. dict). Is this what you are thinking about?

Details in a blog post here: https://huggingface.co/blog/llchahn/ai-agents-output-schema

comment 1y ago · link · parent

Wrapping tool calls in code together with using the benefits of the MCP output schema was implemented in smolagents for some time. Think that’s even one step further conceptually. https://huggingface.co/blog/llchahn/ai-agents-output-schema

comment 1y ago · link · parent

smolagents provides something very similar: https://huggingface.co/blog/llchahn/ai-agents-output-schema

comment 1y ago · link · parent

The latest Model Context Protocol introduces Output Schema: agents now know the exact data structure a tool will return before calling it.

This eliminates the "print-and-inspect" pattern where CodeAct agents call tools just to discover what data they get back. Instead of multi-step exploration, agents can write complete, precise programs from the start.

What's new: Tools declare their output schemas upfront

What's better: Agents plan complete execution paths instead of reactive discovery

Now supported in Hugging Face smolagents.

7.

Output Schema for CodeAct AI Agents: From Trial-and-Error to Predictive Planning(huggingface.co ↗)

3 points · by menix · 1y ago · 1 comment

comment 8y ago · link · parent

For me magnesium (oral) works very well. 100mg to 300mg per day. Decreased my migraine from weekly to once per half year.

comment 9y ago · link · parent

Mark Gurman even mentioned a lot of good people were leaving the company. (https://www.bloomberg.com/news/articles/2016-12-20/how-apple...)