Skip to main content
Glama

runtime_sandboxes_exec

Destructive

Run a shell command (bash -c) or an argv in a sandbox and get exitCode, stdout and stderr. Output over 16,000 characters in all keeps each stream's first line and its end, with outputCut and a note on reading the rest from a file. Waits for a sandbox that is still starting. A timeout returns timedOut: true with the output so far. background: true returns a processId at once, for servers, watchers and interactive programs; runtime_sandboxes_process reads and controls it. Runs as the sandbox user with passwordless sudo, HOME=/workspace; user root runs it as root instead, with no sudo needed. env sets environment variables and keeps their values out of the command line.

Input Schema

NameRequiredDescriptionDefault
idYes
cwdNoWorking directory. Default /workspace.
envNoEnvironment for this command, merged over the sandbox's. Put secrets here, never in the command line: env is never echoed back.
argvNoOr the program and its arguments, run without a shell.
userNoWho runs it: the sandbox user (uid 1000, HOME=/workspace), or root, through the sandbox's passwordless sudo with the same environment and PATH and HOME=/root. Saves prefixing every command with sudo. Default: the sandbox's own user setting, which is the sandbox user unless it was created or updated with user root.
stdinNoText given to the command's standard input, which is then closed.
commandNoA shell command, run as `bash -c "<command>"` (pipes, &&, redirection and globs work), or a list of the program and its arguments, run without a shell.
timeoutMsNoDefault 60000. Up to 24 h.
backgroundNoStart it and return at once with a processId.
stdinBase64NoBytes for standard input, base64.
idempotencyKeyNoOptional: left out, one is made and returned as idempotencyKey. Send it back only to retry this exact call after a temporary error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / user / default
      Removed value: -"sandbox"
    • changedInput schema / properties / user / description
      Previous value: -"Who runs it: the sandbox user (uid 1000, HOME=/workspace), or root, through the sandbox's passwordless sudo with the same environment and PATH and HOME=/root. Saves prefixing every command with sudo."New value: +"Who runs it: the sandbox user (uid 1000, HOME=/workspace), or root, through the sandbox's passwordless sudo with the same environment and PATH and HOME=/root. Saves prefixing every command with sudo. Default: the sandbox's own user setting, which is the sandbox user unless it was created or updated with user root."
  2. Changed1 schema field changed
    • addedInput schema / properties / user
      Added value: +{
      +  "default": "sandbox",
      +  "description": "Who runs it: the sandbox user (uid 1000, HOME=/workspace), or root, through the sandbox's passwordless sudo with the same environment and PATH and HOME=/root. Saves prefixing every command with sudo.",
      +  "enum": [
      +    "sandbox",
      +    "root"
      +  ],
      +  "type": "string"
      +}
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the destructive/openWorld annotations: 16,000-char per-stream truncation with first line plus tail and outputCut, timeout returning timedOut: true with partial output, background returning a processId immediately, and the execution identity (sandbox user with passwordless sudo, HOME=/workspace, root alternative). It also notes env values are never echoed back, which is meaningful secret-handling context.

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?

Front-loaded with the core action and result shape, then progressive detail on truncation, timeout, background and identity. Dense but nearly every clause adds information; the closing env sentence partially restates the schema description.

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?

With 11 parameters and no output schema, the description supplies what's missing: the result fields (exitCode, stdout, stderr, timedOut, outputCut, processId, idempotencyKey) and the truncation/timeout behaviors that change how an agent must parse output. Nothing essential for correct invocation is absent.

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 coverage is already 91%, so the baseline would be 3; the description earns above that by explaining the observable effect of user/root, the sudo-saving intent, timeout semantics, and the security rationale for env. Minor overlap with schema text (env, timeoutMs) keeps it from a 5.

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?

Opening sentence names a specific verb (run), the resource (a command in a sandbox), both invocation modes (bash -c or argv) and the return values (exitCode, stdout, stderr). It also routes background work to runtime_sandboxes_process, distinguishing it from that 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?

Explicitly states when to use background: true (servers, watchers, interactive programs) and which sibling controls the resulting process. It also notes the tool waits for a still-starting sandbox. It doesn't cover when to prefer runtime_sandboxes_interpreter_run or files_write over a raw shell command, so it stops short of full when/when-not guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.