ssh_exec
Run a shell command on a remote host over an existing SSH session and get its stdout, stderr, and exit code. Use absolute paths or chained commands for multi-step tasks, since each call starts a fresh shell.
Instructions
Run a shell command on the remote host over an existing session and
return its stdout, stderr, and exit code. Output is truncated if very
large. Not a persistent shell — each call is a fresh exec_command, so
cd and env vars set in one call don't carry to the next (chain with
&& or use absolute paths / a wrapper script for multi-step sequences).
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": {
"session_id": "<session_id>",
"command": "<command>"
},
"name": "ssh_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| timeout | No | ||
| session_id | Yes |