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. env sets environment variables and keeps their values out of the command line.

Input Schema

TableJSON 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.
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. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations declare destructive/openWorld/not-readOnly, and the description adds substantial non-obvious behavior: the 16,000-char truncation rule with outputCut and file fallback, waiting on a starting sandbox, timeout returning timedOut with partial output, and background returning a processId. It also discloses the execution identity (sandbox user with passwordless sudo, HOME=/workspace) — exactly the context that matters for a destructive exec tool.

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, then dense behavior notes with no filler — each sentence carries distinct information (truncation, waiting, timeout, background, privileges, env). Slightly run-on and long, but nothing is redundant or wasted.

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 no output schema, the description takes on the return-value burden and covers it: exitCode, stdout, stderr, timedOut, processId, outputCut. Combined with truncation, timeout and background semantics, an agent has everything needed to invoke and interpret this tool.

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 90%, so the schema carries most parameter documentation and baseline 3 applies. The description still adds cross-parameter meaning the schema doesn't: env keeps secrets off the command line, and background yields a processId consumed by runtime_sandboxes_process. This is value beyond the field-level descriptions.

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 or argv in a sandbox — and immediately names the sibling that handles the background case (runtime_sandboxes_process). An agent can distinguish this from runtime_sandboxes_interpreter_run or runtime_sandboxes_process 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 clear context for the background flag ('servers, watchers and interactive programs') and routes to the controlling sibling tool. It also tells the agent it can wait on a starting sandbox. It lacks an explicit when-not clause (e.g. foreground vs interpreter_run), but the conditional guidance is well above average.

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.