Run Command
run_commandExecute arbitrary RouterOS console commands over SSH, guarded by an allow/deny policy with dry-run policy checks. Journaled but not rollbackable — prefer dedicated tools when available.
Instructions
Execute an arbitrary RouterOS console command via SSH. Guarded by an allow/deny policy (built-in deny list blocks destructive commands; tighten via cmdAllow in routers.yaml or MIKROMCP_CMD_ALLOW). Prefer dedicated tools (reboot, etc.) where available. Output capped at 4000 characters. dryRun checks the allow/deny policy only (the result says validated: policy, syntaxChecked: false): it does not check the syntax or what the command refers to, so a passing dry run does not show the command will work. Journaled for audit like every write (see list_journal), but never snapshotted: arbitrary commands touch unknown config sections, so it cannot be rolled back via rollback_change — prefer a dedicated tool when one exists, and note the manual undo command in your own records.
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 |
|---|---|---|---|
| dryRun | No | Preview the command without executing. Checks the allow/deny policy only: not the syntax, not the names it refers to, not what a [find ...] would match | |
| command | Yes | RouterOS console command to execute | |
| routerId | No | Router ID; omit to use the default router. | |
| confirmationToken | No | Token from a prior APPROVAL_REQUIRED response. Re-submit the identical call with this token to confirm the destructive action. |