Skip to main content
Glama

EQVPS — VPS and code sandboxes for AI agents

Run code in a sandbox

run_code

Run a code snippet inside a sandbox and return {exit_code, stdout, stderr, timed_out, truncated, duration_ms}. language: python (Python 3.12), node (Node.js 22) or bash. Install packages first with exec_command (pip install … / npm i …). The code is passed to the interpreter on stdin, so it cannot read stdin itself. timeout seconds (default 30, max 55 per call). LONGER JOBS: set background: true — returns a task_id immediately (timeout then defaults to the sandbox's remaining lifetime); poll get_task with the returned offsets to read new output and the exit code, kill_task to stop it. The sandbox keeps billing while a task runs and is not idle-deleted. Output is capped at 1 MiB per stream for synchronous calls. Files and installed state persist between calls in the same sandbox. Requires: token + live sandbox_id. Typical: timed_out after 55 s → repeat with background: true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNoEnvironment variables for this run only (override the ones set at create_sandbox).
codeYes
timeoutNoSeconds. Synchronous: max 55. With background: true: up to the sandbox's remaining lifetime (default).
languageYes
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 run only (override the ones set at create_sandbox).",
      +  "propertyNames": {
      +    "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
      +  },
      +  "type": "object"
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / background
      Added value: +{
      +  "type": "boolean"
      +}
    • changedInput schema / properties / language / enum
      Previous value: -[
      -  "python",
      -  "bash"
      -]New value: +[
      +  "python",
      +  "node",
      +  "bash"
      +]
    • 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.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: code is passed on stdin so it cannot read stdin, per-stream output cap of 1 MiB, files and installed state persist within a sandbox, billing continues while a background task runs, and token + live sandbox_id are required. These are exactly the behavioral traits an agent cannot infer from the schema.

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-loads the return shape, then parameters, then the LONGER JOBS escape hatch, then constraints and prerequisites. It is long but every clause adds actionable information, and the 'Typical:' line gives a compact remedy for the most common failure.

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?

A six-parameter mutation-like tool with no output schema and no annotations is fully covered: return values, background lifecycle, persistence, billing, limits, and auth prerequisites are all stated. Nothing needed to invoke it correctly is missing.

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 by mapping language values to versions (Python 3.12, Node.js 22, bash) and explaining timeout's default/max split between sync and background modes, plus the stdin constraint on code. env is left to the schema, which documents it, so this is strong but not exhaustive.

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+resource ('Run a code snippet inside a sandbox') and immediately names the return shape {exit_code, stdout, stderr, timed_out, truncated, duration_ms}. It distinguishes itself from siblings by pointing to exec_command for package installs and get_task/kill_task for background polling.

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?

Explicit routing: install packages with exec_command first, use get_task with returned offsets to poll, kill_task to stop, and re-run with background: true when a job hits the 55 s synchronous ceiling. Includes the concrete 'timed_out after 55 s' trigger that selects the alternative.

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.