Skip to main content
Glama

EQVPS — VPS and code sandboxes for AI agents

Execute a shell command in a sandbox

exec_command

Execute a shell command (bash -lc) in a sandbox as root and return {exit_code, stdout, stderr, timed_out, truncated, duration_ms}. Shell operators are fine and never filtered: apt-get update && pip install x | tee log; echo done > out. If you call the server with raw HTTP/curl, the JSON body must be valid — escape double quotes inside command (") or build the body with a JSON library; a broken body returns a JSON-RPC parse error (-32700), not a firewall block. Optional cwd (default /root) and timeout (default 30 s, max 55 per call). For commands longer than 55 s (builds, training, long downloads) set background: true: you get a task_id at once, then poll get_task for output and the exit code; kill_task stops it. Requires: token + live sandbox_id. Typical: timed_out after 55 s → repeat with background: true; 404 → sandbox expired, create a new one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo
envNoEnvironment variables for this command only (override the ones set at create_sandbox).
commandYes
timeoutNoSeconds. Synchronous: max 55. With background: true: up to the sandbox's remaining lifetime (default).
backgroundNo
sandbox_idYesSandbox id as returned by create_sandbox / list_sandboxes, e.g. "sb_3f2a…".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / env
      Added value: +{
      +  "additionalProperties": {
      +    "maxLength": 32768,
      +    "type": "string"
      +  },
      +  "description": "Environment variables for this command only (override the ones set at create_sandbox).",
      +  "propertyNames": {
      +    "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
      +  },
      +  "type": "object"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / background
      Added value: +{
      +  "type": "boolean"
      +}
    • addedInput schema / properties / timeout / description
      Added value: +"Seconds. Synchronous: max 55. With background: true: up to the sandbox's remaining lifetime (default)."
    • removedInput schema / properties / timeout / maximum
      Removed value: -55
  3. Added

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the entire behavioral burden and does so thoroughly: runs as root, shell operators are never filtered, synchronous timeout capped at 55 s, background returns a task_id killable via kill_task, and 404 means the sandbox expired. It even warns that a malformed JSON body yields a -32700 parse error rather than a firewall block.

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?

Dense and front-loaded: purpose and return shape lead, followed by operational caveats and error recovery. Every sentence earns its place, though the multi-clause sentences and embedded troubleshooting make it heavier than strictly necessary.

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?

There is no output schema, but the description spells out the return object (exit_code, stdout, stderr, timed_out, truncated, duration_ms) and the background task_id flow, covering both call modes end to end. Prerequisites, failure modes, and async polling are all present.

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 50%, and the description compensates with defaults not in the schema: cwd defaults to /root, timeout defaults to 30 s with a 55 s synchronous cap, and background switches the timeout semantics and return value. Only env is left to the schema, where it is already fully documented.

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 states a precise verb+resource (execute a shell command via bash -lc in a sandbox) and even names the exact return shape, so the agent knows exactly what it does. It does not differentiate from the sibling run_code, which also executes code in a sandbox, so it stops short of a 5.

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?

Strong operational guidance: use background: true for commands over 55 s and poll get_task, repeat with background on timed_out, and treat 404 as an expired sandbox to be recreated. It also states prerequisites (token + live sandbox_id). It never explicitly routes the agent between this and the sibling run_code, which is the one clear exclusion missing.

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.