Skip to main content
Glama

EQVPS — VPS and code sandboxes for AI agents

Execute a shell command in a sandbox

exec_command
Destructive

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

NameRequiredDescriptionDefault
cwdNoOptional. Working directory, absolute path, e.g. "/root/app". Default "/root".
envNoOptional. Environment variables for this command only (override the ones set at create_sandbox). Example: {"DEBUG": "1"}.
commandYesRequired. Shell command run as root via bash -lc; operators like &&, | and > are allowed, e.g. "pip install requests && python app.py".
timeoutNoOptional. Seconds. Synchronous: max 55. With background: true: up to the sandbox's remaining lifetime (default).
backgroundNoOptional. True = run as a background task and return `task_id` at once (poll get_task). Default false (wait up to `timeout`, max 55 s).
sandbox_idYesRequired. Sandbox id as returned by create_sandbox / list_sandboxes, e.g. "sb_3f2a…".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / background / description
      Added value: +"Optional. True = run as a background task and return `task_id` at once (poll get_task). Default false (wait up to `timeout`, max 55 s)."
    • addedInput schema / properties / command / description
      Added value: +"Required. Shell command run as root via bash -lc; operators like &&, | and > are allowed, e.g. \"pip install requests && python app.py\"."
    • addedInput schema / properties / cwd / description
      Added value: +"Optional. Working directory, absolute path, e.g. \"/root/app\". Default \"/root\"."
    • changedInput schema / properties / env / description
      Previous value: -"Environment variables for this command only (override the ones set at create_sandbox)."New value: +"Optional. Environment variables for this command only (override the ones set at create_sandbox). Example: {\"DEBUG\": \"1\"}."
    • changedInput schema / properties / sandbox_id / description
      Previous value: -"Sandbox id as returned by create_sandbox / list_sandboxes, e.g. \"sb_3f2a…\"."New value: +"Required. Sandbox id as returned by create_sandbox / list_sandboxes, e.g. \"sb_3f2a…\"."
    • changedInput schema / properties / timeout / description
      Previous value: -"Seconds. Synchronous: max 55. With background: true: up to the sandbox's remaining lifetime (default)."New value: +"Optional. Seconds. Synchronous: max 55. With background: true: up to the sandbox's remaining lifetime (default)."
  2. 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"
      +}
  3. 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
  4. Added

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already convey the safety profile (destructive, non-idempotent, open-world), and the description correctly aligns with it. It adds real value: root execution, unfiltered shell operators, and the raw-HTTP/curl gotcha where a malformed JSON body yields a -32700 parse error rather than a firewall block. With annotations covering much of the safety context, a 3 is appropriate for the incremental disclosure.

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 purpose and return shape, then packs constraints and error branches efficiently into a single dense paragraph. It is long but nearly every clause (background flow, timeout ceiling, curl caveat) carries actionable information, so little is 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?

For a 6-parameter open-world tool with no output schema, the description supplies the return fields, the sync-vs-background split, the timeout ceiling, the auth requirement (token + live sandbox_id), and error-code semantics. An agent has everything needed to call it correctly.

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

Parameters3/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 documents cwd (default /root), timeout (max 55), background (returns task_id), and env. The description mostly restates these, adding only the default 30 s timeout, which earns baseline 3 rather than more.

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 (execute) and resource (shell command) with the exact execution context: bash -lc, as root, in a sandbox. It also names the return shape {exit_code, stdout, stderr, timed_out, truncated, duration_ms}, letting an agent distinguish it from the sibling run_code without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete routing: long commands (>55 s) should set background:true and then poll get_task, kill_task stops it, a timed_out result should be retried with background:true, and a 404 means the sandbox expired so create a new one. Alternatives (get_task, kill_task, create_sandbox) are named with the conditions that select them.

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.