run_command
Execute shell commands in a secure E2B sandbox, with optional connection to an existing sandbox for continued work.
Instructions
Run a shell command in an E2B sandbox.
Args:
command: Shell command to execute
sandbox_id: Optional sandbox ID to connect to an existing sandbox. If not provided, a new sandbox will be created.
Returns:
JSON string containing stdout, stderr, and exit code from command execution
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": {
"command": "<command>"
},
"name": "run_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| sandbox_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |