Skip to main content
Glama

run_command

Destructive

Run commands in a sandboxed task worktree to execute contract checks or ad-hoc programs and capture exit codes, failure signatures, and recent output for task validation.

Instructions

Run a command in the sandbox, in your task worktree (there is no shell). command_id runs a contract command (recorded as a check of your task); argv runs an ad-hoc program with its arguments. Returns the exit code, a failure signature and the last ~8 KB of output; the full output is stored as a blob (read_blackboard section blob).

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": {
      "execution_id": "<execution_id>",
      "agent_token": "<agent_token>"
    },
    "name": "run_command"
  }
}

Input Schema

NameRequiredDescriptionDefault
argvNoProgram and arguments (no shell strings).
timeout_sNoDefault the command's own timeout, or 600 s for argv.
command_idNoA contract validation command.
agent_tokenYesThe agent token join_execution returned (once).
execution_idYesThe heads-down run (exe-…).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4/5.0
Behavior4/5

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

Annotations flag destructiveHint=true and non-idempotent, and the description adds genuinely new behavior: no shell is available, output is truncated to roughly the last 8 KB, and the full output is persisted as a blob retrievable via read_blackboard. It does not disclose side effects of running commands in the worktree (the destructive aspect) or timeout behavior, so it stops short of full coverage.

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

Conciseness4/5

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

Two dense sentences, front-loaded with the action and location before the mode breakdown; nothing is wasted. The parenthetical asides make it slightly hard to parse at a glance, but the information-to-length ratio is high.

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 usefully covers the return contract (exit code, failure signature, truncated output, blob location) and the no-shell constraint. Minor gaps remain around timeout behavior and whether command_id and argv may be combined, but the critical call requirements are covered.

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

Parameters4/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 defines all five parameters; baseline would be 3. The description earns above baseline by explaining that command_id and argv represent two distinct, meaningfully different execution modes and that argv takes program-plus-arguments rather than a shell string, which the schema does not convey.

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

Purpose4/5

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

The description names a specific verb and resource ('Run a command in the sandbox, in your task worktree') and states a key environmental constraint (no shell). It also distinguishes the two operating modes, contract command vs. ad-hoc program, though it never differentiates itself from the similarly named 'execute' sibling.

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?

It gives clear routing guidance between the two modes: command_id 'runs a contract command (recorded as a check of your task)' while argv 'runs an ad-hoc program with its arguments.' That tells an agent which to pick, but there are no explicit exclusions or prerequisites (e.g., when NOT to run a command, or that the two are mutually exclusive).

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