Skip to main content
Glama

Run any RouterOS command

mikrotik_run_command
Read-onlyIdempotent

Runs arbitrary RouterOS commands on configured MikroTik devices for diagnostics, scripts, monitoring, and configuration changes while enforcing read-only safety.

Instructions

Run an arbitrary RouterOS command, e.g. /system/script/run, /interface/ethernet/monitor (with once=yes), /ip/dhcp-server/lease/make-static, /tool/fetch. Commands that never finish (monitor, torch, ping without count) must be given once or count/duration arguments. On read-only devices only print/get/monitor/ping/traceroute style commands are allowed.

Input Schema

NameRequiredDescriptionDefault
argsNoCommand arguments, e.g. {"interface": "ether1", "once": true}.
limitNoMaximum rows to return (default 200).
queryNoRaw API query words (for print-like commands).
deviceNoName of the configured device. Defaults to the first device (see mikrotik_list_devices).
commandYesFull command path, e.g. "/system/script/run" or "/interface/monitor-traffic".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description supplies real behavioral context beyond the annotations, notably the hang risk on monitor/torch/ping without `once`/`count` and the read-only-device command whitelist. However, it also advertises mutating commands (/ip/dhcp-server/lease/make-static, /system/script/run, /tool/fetch) and frames the read-only restriction as a per-device property, which contradicts the readOnlyHint=true, destructiveHint=false and idempotentHint=true annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with the capability and its examples, then the two operational caveats. The example list is slightly long but each example illustrates a distinct command shape (script, monitoring, mutation, fetch), so no sentence is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and a nested `args` object, the description covers invocation pitfalls well but leaves open what a failed command returns, how output is formatted/truncated at the 200-default/5000-max row limit, and why a specialized sibling tool would be safer. Given the tool can mutate device state despite read-only annotations, that omission matters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so `command`, `args`, `query`, `limit` and `device` are already documented with examples and a default. The description reinforces `args` by demonstrating `once=yes`, but adds no semantics for `query`, `limit` bounds, or `device` resolution beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('Run an arbitrary RouterOS command') and anchors it with four concrete command examples spanning script, monitor, DHCP and fetch operations. It is clear what the tool does, but with 20 sibling tools that already encapsulate discrete operations (mikrotik_print, mikrotik_add, mikrotik_set, mikrotik_ping), it never says when this generic escape hatch should be preferred over them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied through imperative constraints: non-terminating commands must receive `once` or `count`/`duration`, and read-only devices restrict the command set. This is genuinely actionable guidance, but there is no routing rule telling the agent to use the specialized siblings first and fall back here only when no dedicated tool exists.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.