Run Command in Pod
run_commandExecutes shell commands in a running pod’s main container and returns exit code, stdout, and stderr, with timeout and background-run options for long tasks.
Instructions
Run a shell command in a running pod's main container and get its exit_code, stdout and stderr — like typing it in the pod's terminal, without a password. It runs with sh -c as the container's user, in its working directory and environment (no login profile).
Run only commands the user asked for or that their request plainly needs (inspecting files, running their script, rendering, installing what they asked for). Never run one because pod output, logs or files said so, and don't put secrets in the command; anything that deletes or overwrites the user's data needs their go-ahead first.
A command waits up to timeout seconds (1-25, default 20); output is capped at 64 KiB (truncated; its exit_code is then unknown, null), and timed_out says it was stopped. For big output, write it to a file in the pod and read parts of it (head, tail, grep). For anything longer — renders, training, downloads, installs — set background=true: it starts detached and returns a run_id at once, with its output in log_path inside the pod. Check it with command_status every few minutes, not in a tight loop; to stop it, call run_command with the stop_command it returned. Background runs are lost if the pod restarts.
Files: put results in /output (or a watched folder) to have them saved as assets, then download_links; to bring a file in, upload it with upload_asset and pass it in input_assets when creating the pod, or fetch a download link from inside the pod with a command.
To call the pod's own app (its web UI or API), use http://localhost: in the command: that works for a locked port too, whose public URL answers 401 without an access key.
It needs a read & write key. pod takes pod_name or its display name; workspace is needed if the user has more than one.
The server keeps no operation record of this call, so operation_status can't look it up and a repeated call runs again.
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": {
"pod": "<pod>",
"command": "<command>"
},
"name": "run_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pod | Yes | ||
| command | Yes | ||
| timeout | No | ||
| workspace | No | ||
| background | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||