published fresh until

Typed function calls or one run(command) tool for my agent's actions?

Summary When a growing catalog of typed agent tools makes selection and recovery harder, consider a single Unix-style run(command) tool with progressive help, actionable errors, visible stderr, and an exit-code footer. The post is anecdotal; replies raise security concerns about shell access and sandboxing.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

You are building your own agent and keep adding typed tools (search, read file, write file, send email). Selection gets worse as the list grows, results flood the context, and the model guesses blindly after failures.

Tool-selection failures are in scope when you are considering changing the action interface. Not for improving names, schemas or descriptions within an unchanged tool catalog; see fix tool design.

What the source says

A r/LocalLLaMA post by u/MorroHsu (12 March 2026) says: after two years building agents (the author says he was a backend lead at Manus), a single run(command="...") tool with Unix-style commands outperformed a catalog of typed function calls. These are the author's claims, not a controlled study. The concrete design:

  • One tool, a chain parser. |, &&, || and ; are parsed in a command-routing layer, so one call can be a whole workflow (read, filter, count) instead of three calls.
  • Progressive discovery. The tool description lists commands with one-line summaries; calling a command with no arguments returns its usage; a missing subcommand argument returns the exact parameters.
  • Errors as navigation. Every error says what went wrong and what to do instead, for example "binary image file, use: see photo.png", or "unknown command; available: cat, ls, ...".
  • Never drop stderr. In the author's story a silently dropped stderr led the agent to try ten package managers; once stderr was shown, one call would have sufficed.
  • Consistent footer on every result, such as [exit:0 | 12ms], so the model learns success, failure and cost.
  • Two layers. The execution layer stays raw so pipes work; a separate presentation layer guards binary output, truncates long output (for example above 200 lines or 50 KB) while saving the full output to a file and telling the model how to grep or tail it, and adds the footer.

What the thread pushed back on

A question was about security: typed calls give hard access boundaries, a run tool seems to need full trust. The author replied that most commands never reach a real OS: a command router dispatches them to native functions, and only real execution goes into an isolated micro-VM. Other replies: this resembles CodeAct (agents writing code; the CodeAct paper reports up to 20 percent higher success than JSON or text actions across 17 models in its authors' own tests, using Python rather than shell commands), a code-interpreter-only tool was said to work well in one paper, a commenter found weaker models struggle with sed-style edits so he adds a dedicated write tool, and several said full shell access is risky. A commenter also noted the sandbox must be hardened for untrusted input.

How to describe it to your agent

Replace our 15 typed tools with one run(command) tool that routes to our functions. Implement pipes and &&. Make every command print usage when called without arguments. Errors must say what to do instead. Always return stderr. Append [exit:N | time] to every result. Truncate output over 200 lines, save the full text to a file and say how to grep it. Do not give it a real shell unless it runs in a sandbox.

Mistakes to check

  • Giving the agent a raw host shell instead of a router or a sandbox.
  • Truncating inside the pipe layer so later commands see partial data.
  • Dropping stderr or returning binary data to the model.

Limits

The single-tool advantage is the author's anecdotal experience, not a controlled comparison. A related thread covers how many tools an MCP server should expose.

Sources

Checked 2026-11-17: the Reddit post and comments for the design details, the dropped-stderr story, the security question and the author's reply about a micro-VM. Not checked independently: the author's identity and Manus role. I did not find a Manus publication that describes a single run tool; the Manus context-engineering post found in a search was not read in full and concerns tool masking and file-system memory. The claim that a single tool beats typed calls is the author's experience, and nothing was run.

Started from a post by @MorroHsu, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Typed function calls or one run(command) tool for my agent's actions?
Summary: When a growing catalog of typed agent tools makes selection and recovery harder, consider a single Unix-style run(command) tool with progressive help, actionable errors, visible stderr, and an exit-code footer. The post is anecdotal; replies raise security concerns about shell access and sandboxing.
Copy for agent
get the whatworks thread agent-one-run-command-tool-vs-typed-function-calls and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread agent-one-run-command-tool-vs-typed-function-calls
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks