Skip to main content
Glama

Rafid Intelligence Network

sandbox_code_execute

Read-only

Execute Python, JavaScript, TypeScript, or Bash code inside an ephemeral isolated E2B cloud microVM sandbox and return stdout, stderr, structured outputs, and execution errors. When: Use when an agent needs to run untrusted or computational code, verify scripts, process data, or execute shell commands in an isolated cloud sandbox. Selection: primary; prefer for Use when an agent needs to run untrusted or computational code, verify scripts, process data, or execute shell commands in an isolated cloud sandbox.. Input is a strict JSON object; see the schema. Price: $0.05 USD per call. A free preview is available through preview_capability before payment. Full execution is paid per call via x402; an unpaid MCP call returns payment instructions.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "sandbox_code_execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesSource code or shell commands to execute inside an isolated E2B cloud microVM sandbox.
envsNoOptional environment variables injected into the sandbox execution.
languageNoRuntime language for execution.python
timeoutMsNoExecution timeout in milliseconds (1000 to 60000).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description reinforces that with 'ephemeral isolated' sandbox framing, so the non-destructive profile is consistent. Crucially it adds behavior the annotations cannot convey: $0.05 per call, x402 payment mechanics, an unpaid call returning payment instructions rather than results, and the free preview path.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening sentence is well front-loaded and information-dense, and the payment info deserves its place. However, the 'Selection: primary; prefer for Use when an agent needs to…' sentence is a malformed duplication of the preceding When clause, and 'Input is a strict JSON object; see the schema' is pure filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need not be re-explained, and the description covers execution surface, isolation model, and the payment/preview funnel that an agent must navigate before a paid call. The only real omission is that envs and timeoutMs behavior (e.g., what happens on timeout) is left entirely to the schema.

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%, with every parameter (code, envs, language, timeoutMs) documented including defaults and bounds, so the schema carries the semantics. The description adds only that input is 'a strict JSON object' and names the four supported languages, which is already in the language enum.

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) plus the resources (Python, JavaScript, TypeScript, or Bash code) and adds the scope of an ephemeral isolated E2B microVM, and it explicitly lists the returns (stdout, stderr, structured outputs, errors). An agent can immediately tell this is a sandboxed code runner rather than any of the finance/property/CV sibling tools.

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?

The 'When:' clause gives concrete trigger conditions (untrusted code, verifying scripts, processing data, shell commands) and the pricing sentences route the agent to preview_capability for a free preview before paying. What is missing is any explicit 'when not to use' or exclusion criteria, and the 'Selection: primary; prefer for …' sentence merely repeats the When clause verbatim.

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.