Run a remote command
ssh_execRun non-interactive shell commands on configured remote hosts and return exit code, stdout, and stderr; use cwd or chain commands because each call starts a new shell.
Instructions
Runs a shell command on a host and returns its exit code, stdout and stderr. The command gets no stdin and no terminal, so it must be non-interactive. Each call starts a fresh shell: use cwd, or chain with &&, instead of relying on an earlier cd. Large output is truncated in the middle; narrow it with grep, head or tail.
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": {
"host": "<host>",
"command": "<command>"
},
"name": "ssh_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Directory to run the command in | |
| host | Yes | Name of a configured host, as returned by ssh_list_hosts | |
| command | Yes | Shell command line to run | |
| timeoutSec | No | Seconds to wait before giving up | |
| maxOutputBytes | No | Cap for stdout and for stderr, each |