Skip to main content
Glama

sandbox_run

Run shell commands inside a disposable Linux sandbox VM to execute code, install packages, or inspect files, returning stdout, stderr, exit code, and timeout status.

Instructions

Run a shell command inside a sandbox and return what it printed.

Use this to execute code, install packages, inspect files, or do anything else on the sandbox computer. The command is run by bash, so pipes, redirects, && and multi-line scripts all work. Each call starts in the home directory with a fresh shell: files persist between calls, but cd and environment variables do not. The command gets no keyboard input, so use non-interactive flags (for example apt-get -y).

timeout_seconds: how long the command may run (1 to 3600, default 60). When the limit is reached the command is killed and timed_out is true.

Returns stdout, stderr, exit_code (0 means success) and timed_out. Very long output is cut at 1 MB; stdout_truncated / stderr_truncated say when that happened.

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": {
      "sandbox_id": "<sandbox_id>",
      "command": "<command>"
    },
    "name": "sandbox_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
commandYes
sandbox_idYes
timeout_secondsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so thoroughly: fresh shell per call, home-directory start, files persisting while cwd and env vars do not, no keyboard input, non-interactive flag requirement, kill-on-timeout semantics, and 1 MB output truncation flags. These are exactly the non-obvious traits an agent would otherwise discover by failing.

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?

Front-loaded with the core action, then layered: usage contexts, shell-state caveats, interactivity constraint, timeout parameter, return shape. Every sentence adds operational information; there is no filler or restatement of the tool name.

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

Completeness5/5

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

For a shell-execution tool with no annotations and three parameters, this covers execution model, state persistence, input constraints, timeout behavior, and output shape. The only minor gap is the unexplained sandbox_id, whose meaning is largely inferable from the sibling set (sandbox_create/sandbox_list).

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 0%, so the description must compensate. It fully explains timeout_seconds (range 1–3600, default 60, kill behavior and timed_out flag) and characterizes command as bash-executed with pipes/redirects/multi-line support. sandbox_id is never explained — no hint about where the id comes from or whether the sandbox must already exist.

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 specific verb and resource — 'Run a shell command inside a sandbox' — plus what it returns. This is unmistakably distinct from siblings like sandbox_copy_in, sandbox_click, or sandbox_create, so an agent can route correctly without opening a schema.

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 concrete positive usage contexts: execute code, install packages, inspect files, 'or do anything else on the sandbox computer.' It does not name alternatives or state when not to use it (e.g. prefer sandbox_copy_in for transferring files), so it falls short of explicit routing guidance.

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