Skip to main content
Glama

Run Command

run_command
Destructive

Execute 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

NameRequiredDescriptionDefault
dryRunNoPreview 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
commandYesRouterOS console command to execute
routerIdNoRouter ID; omit to use the default router.
confirmationTokenNoToken from a prior APPROVAL_REQUIRED response. Re-submit the identical call with this token to confirm the destructive action.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.17.0
    • changedInput schema / properties / dryRun / description
      Previous value: -"Preview the command without executing (validates allow/deny policy only)"New value: +"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"
  2. Changed2 schema fields changedv1.6.0
    • changedInput schema / properties / routerId / description
      Previous value: -"Target router identifier from the router registry"New value: +"Router ID; omit to use the default router."
    • changedInput schema / required
      Previous value: -[
      -  "routerId",
      -  "command"
      -]New value: +[
      +  "command"
      +]
  3. Addedv1.5.0
  4. Removedv1.1.0
  5. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description goes well beyond them: it names the allow/deny policy and how to tighten it (cmdAllow / MIKROMCP_CMD_ALLOW), the 4000-character output cap, the audit-journal-but-no-snapshot behavior, and the resulting inability to roll back. That rollback limitation is exactly the kind of consequence an agent needs before calling a destructive tool.

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?

Core purpose and the alternative-tool preference are front-loaded, and the dryRun and rollback warnings are placed where an agent will read them. It loses a point for repetition: 'prefer a dedicated tool' appears twice and the dryRun policy-only caveat is stated in both the description and the schema.

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

Completeness5/5

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

With no output schema, the description still covers return-shape essentials (output capped at 4000 characters, dryRun returns validated: policy and syntaxChecked: false) and the write/audit/rollback lifecycle. Nothing material for correct invocation is missing for a destructive, unconstrained-command tool.

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 all four parameters are already documented, and the description largely restates the dryRun caveat already present in the schema. It adds no new meaning about command syntax, routerId selection, or how the confirmationToken round-trip is triggered beyond what the schema states. Baseline 3 applies when the schema does the heavy lifting.

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

Purpose5/5

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

States a specific verb and resource ('Execute an arbitrary RouterOS console command via SSH') and immediately frames the escape-hatch nature of the tool against the dedicated siblings ('Prefer dedicated tools (reboot, etc.) where available'). An agent can tell this apart from run_script, reboot, or apply_plan without opening any schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use (arbitrary console command not covered by a dedicated tool) and when-not-to-use ('Prefer dedicated tools ... where available', repeated with the rollback caveat). It also scopes dryRun correctly, warning that a passing dry run does not prove the command will work.

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

Deploy Server

Other Tools