Run command on VPS
vps_execExecute a one-shot SSH command on a VPS and return { stdout, stderr, exitCode }.
Use timeoutSeconds (default 30, max 300) for the per-command timeout.
For long-running commands (>300s) such as apt full-upgrade, large rsync, or
package builds, do NOT block the call. Instead launch the work in the
background and poll a log file:
vps_exec(id, "nohup bash -c 'apt-get update && apt-get full-upgrade -y' >/root/job.log 2>&1 & echo $! > /root/job.pid; echo started")
then poll:
vps_exec(id, "if kill -0 $(cat /root/job.pid) 2>/dev/null; then echo RUNNING; tail -20 /root/job.log; else echo DONE; tail -50 /root/job.log; fi")
stdout and stderr are limited to 256 KB each, keeping the start and the end; the response includes truncated: true if so.
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>",
"command": "<command>"
},
"name": "vps_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The VPS ID | |
| command | Yes | The shell command to execute | |
| timeout | No | DEPRECATED: use `timeoutSeconds`. Same semantics (seconds). | |
| timeoutSeconds | No | Per-command timeout in seconds. Default 30, max 300. For longer work, use the nohup+log-polling pattern from the tool description. |