Run a RouterOS command over SSH
mikrotik_execRun a single RouterOS command on a configured MikroTik router over SSH and return the output. Each call is stateless; use absolute command paths.
Instructions
Run a single RouterOS command on a configured router over SSH and return its output. Stateless: each call opens a fresh connection and closes it before returning, so there is no session, working directory or shell state carried between calls — send absolute command paths such as '/system resource print'. Profiles are read-only by default, in which case commands that would change the router are refused before connecting. Use mikrotik_list_profiles to find profile names. Item numbers printed by RouterOS are NOT stable: they are reassigned per session and again on the next print, and every call here is a new session. Never pass a number seen in an earlier call to a later one — it will act on whatever holds that number now. Select by predicate instead, e.g. /ip firewall filter remove [find where comment="x"]. See mikrotik_search_docs for more.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | RouterOS command, e.g. '/system resource print' or '/ip address print detail'. | |
| profile | Yes | Profile name from mikrotik_list_profiles. | |
| timeoutMs | No | Override the profile's timeout for this call. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| stderr | Yes | ||
| stdout | Yes | ||
| exitCode | Yes | ||
| durationMs | Yes | ||
| hostKeyFingerprint | No |