sandbox_exec_background
Execute shell commands and start long-running processes like dev servers or file watchers in an E2B sandbox environment. The command runs immediately in the background without waiting for it to complete, enabling non-blocking operations in isolated cloud sandboxes.
Instructions
Start a background process in a sandbox (e.g., dev server, file watcher). Returns immediately without waiting for completion.
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_background"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sandboxId | Yes | The sandbox ID to run the command in. | |
| command | Yes | The shell command to run in the background. | |
| cwd | No | Working directory. Defaults to /home/user. | |
| envs | No | Environment variables for this command. |