sandbox_exec
Execute shell commands in a sandbox to run builds, tests, installs, or CLI commands, returning stdout, stderr, and exit code for integration into automated workflows.
Instructions
Execute a shell command in a sandbox and return stdout, stderr, and exit code. Use for running builds, tests, installs, or any CLI command.
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": {
"sandboxId": "<sandboxId>",
"command": "<command>"
},
"name": "sandbox_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sandboxId | Yes | The sandbox ID to run the command in. | |
| command | Yes | The shell command to execute (e.g., "npm install", "python main.py"). | |
| cwd | No | Working directory inside the sandbox. Defaults to /home/user. | |
| timeoutMs | No | Command timeout in milliseconds. Default: 120000 (2 min). Set 0 for no timeout. | |
| envs | No | Environment variables to set for this command. |