Run a command in a machine
instabox_execExecute shell commands or argv programs inside a running cloud Linux machine and return stdout, stderr, and exit code after completion. Use for remote command execution with a 600-second limit.
Instructions
Run a command inside a RUNNING machine and return stdout, stderr and the exit code once it exits (a non-zero exit is still a normal result). Output is collected, not streamed, and each stream is cut at 1 MiB. Give cmd (a shell string, run with bash -lc) OR argv (program + arguments, no shell, no expansion). Runs as the machine's user in /data/home by default. Max 600 s per call: for long jobs start them in the background (e.g. nohup … > /data/home/job.log 2>&1 &) and poll the log. Not idempotent: a retry runs the command again. A machine paused for idleness is woken first; a machine you stopped returns 409 machine_not_running. This executes arbitrary code with root-capable access in the machine.
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": {
"id": "<id>"
},
"name": "instabox_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Machine ID (m_...) or its unique name | |
| cmd | No | Shell command (bash -lc). Set this or argv | |
| cwd | No | Working directory (default /data/home) | |
| argv | No | Program and arguments, run without a shell. Set this or cmd | |
| envs | No | Environment variables to set. Names match [A-Za-z_][A-Za-z0-9_]* | |
| stdin | No | Text fed to the command, then EOF (max 1 MiB) | |
| timeoutSeconds | No | Kill after this long (exit code 124). Default 60, max 600 |