sandbox_code_execute
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
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Source code or shell commands to execute inside an isolated E2B cloud microVM sandbox. | |
| envs | No | Optional environment variables injected into the sandbox execution. | |
| language | No | Runtime language for execution. | python |
| timeoutMs | No | Execution timeout in milliseconds (1000 to 60000). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||