Skip to main content
Glama

Run command

exec
Destructive

Runs a shell command on a running Hadronbox machine and returns exit code, stdout, and stderr, with timeout and output limits for controlled remote execution.

Instructions

Run a shell command line in a running machine and return its exit code, stdout and stderr. Project files live under /workspace (start with "cd /workspace && ..."). Long output is shortened in the middle. The command is stopped when timeout_seconds passes. No stdin; for multi-line programs write a script with write_file first.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "machine_id": "<machine_id>",
      "command": "<command>"
    },
    "name": "exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
commandYesShell command, e.g. "npm test".
machine_idYesMachine id (machine_id from create_machine or list_machines).
timeout_secondsNoStop the command after this many seconds (default 120, max 3600).
max_output_charsNoKeep at most this many characters of stdout and of stderr (default 20000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructive, openWorld, non-idempotent, and not read-only. Beyond that, the description discloses truncation ('long output is shortened in the middle'), the kill behavior when timeout_seconds passes, and the absence of stdin, which are concrete behaviors an agent needs. It omits the default working directory, shell used, and whether a non-zero exit surfaces as an error or a normal return, so it stops short of full disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Five short sentences, front-loaded with the core action and return values, then the workspace convention, then the truncation and no-stdin caveats. No sentence is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description correctly spells out the returned fields and how output is truncated and time-limited. The remaining gap is failure semantics: it does not say whether a non-zero exit code is returned normally or raised as an error, which matters for a destructive, non-idempotent tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents machine_id, command, timeout_seconds, and max_output_chars, and the baseline is 3. The description adds only the /workspace convention tied to command and restates the timeout effect, adding little meaning beyond the structured fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource (run a shell command line in a running machine) plus what it returns (exit code, stdout, stderr). That is enough for an agent to distinguish it from write_file, read_file, and the machine lifecycle siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives real operating guidance: project files live under /workspace and commands should start with 'cd /workspace && ...', no stdin is available, and multi-line programs should be written with write_file first. It never states when to prefer read_file or write_file outright instead of shell, so it falls short of explicit alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.