Run backend command
run_backend_commandExecute one command line on a remote host via SSH, Telnet, ADB, WinRM, or Cisco to inspect or manage systems and return exit code, stdout, and stderr.
Instructions
Run one command line on a remote host (SSH, Telnet, ADB, WinRM, Cisco). Use when: a shell command is needed there (ps, df, a Cisco show). Instead: run_backend_script for scripts; the file tools for files. Requires: --mcp-tools exec and --mcp-allow-exec; not in paranoid mode; a backend that list_backends gives commands (not null). Behavior: destructive - runs with the profile user's rights. Refused on production profiles. A non-zero exit is a result; Cisco always reports 0, Telnet and ADB the real code (stderr inside stdout). Time limit: timeout; past it the call fails and no output returns. Returns: {returncode, stdout, stderr, truncated_stdout, truncated_stderr} (text, UTF-8 with undecodable bytes replaced).
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>",
"backend": "<backend>"
},
"name": "run_backend_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Environment variables for the command as {NAME: value}, e.g. {"LANG": "C"}. On POSIX shells they are exported in the command line, so other users of the host may see the values: pass no secrets this way. | |
| stdin | No | Text fed to the command's stdin (UTF-8); not supported on WinRM or Cisco. Default: none. | |
| backend | Yes | Backend id from list_backends (can_run_commands=true), e.g. 'profile:web1'. | |
| command | Yes | The command line, run by the remote's shell, e.g. 'df -h /'. | |
| timeout | No | Seconds the command may run (at most 1740, below the call's 30 min); longer fails with a timeout error and returns no output. | |
| max_output | No | Most bytes of stdout kept; stderr keeps min(max_output, 1 MiB). truncated_stdout / truncated_stderr tell when output was cut. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stderr | Yes | ||
| stdout | Yes | ||
| returncode | Yes | ||
| truncated_stderr | Yes | ||
| truncated_stdout | Yes |