run_ssh_command
Execute pre-approved SSH commands on remote Linux servers using command templates for tasks like checking disk usage, monitoring services, viewing logs, and listing processes.
Instructions
Execute a pre-approved command template on a target host.
Use list_templates to discover available template_ids. Examples:
disk_usage: run df -h (no params needed)
service_status: check a systemd service (params: {"service": "docker"})
list_processes: show top processes by memory (no params needed)
tail_log: tail a log file (params: {"lines": "100", "log_path": "/var/log/syslog"})
Only commands from the template registry are allowed. Parameters are validated against per-template regex rules. Output is automatically redacted for secrets.
Pass session_id from ssh_connect to reuse a persistent connection.
Risk level: medium (requires user confirmation in VS Code).
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_id": "<host_id>",
"template_id": "<template_id>"
},
"name": "run_ssh_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host_id | Yes | ||
| template_id | Yes | ||
| params | No | ||
| session_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||