run_command
Execute shell commands on single or multiple hosts concurrently, with optional background execution and output controls for efficient SSH orchestration.
Instructions
Executes a shell command on a single host ('host') or multiple hosts concurrently ('hosts'). If using 'hosts', returns a JSON map mapping hostnames to their stdout, stderr, and exit codes. Features optional 'background' execution (starting the command and returning a local log file path immediately for async tracking), 'quiet' execution (suppressing progress logs), and output abbreviation controls. Prefer 'hosts' to execute commands across cluster nodes simultaneously.
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 |
|---|---|---|---|
| host | No | The target hostname or IP address | |
| hosts | No | A list of hostname targets to query concurrently | |
| quiet | No | If true, suppresses terminal progress logging in background files (default: false) | |
| command | Yes | The shell command to run on target | |
| max_lines | No | Max lines to return if abbreviate is true (default: 100) | |
| abbreviate | No | If true, limits long stdout output (default: true) | |
| background | No | If true, runs command in background and returns log path immediately (default: false) | |
| timeout_secs | No | Maximum execution time in seconds for the command (default: 60) | |
| progress_interval_secs | No | Number of seconds between progress reporting updates (default: 5) |