Skip to main content
Glama

move_firewall_rule

Reorder an existing MikroTik firewall filter rule by comment, optionally narrowed by chain, to change its position in the chain's evaluation order. Preview before applying; never edits rule fields.

Instructions

Reorder an EXISTING firewall filter rule (/ip/firewall/filter move), resolved by its comment - optionally narrowed by chain if more than one rule shares that comment, same resolution enable_firewall_rule/disable_firewall_rule use.

SAFE BY DESIGN: this NEVER creates or otherwise edits a rule's fields - only its position in the chain's evaluation order changes.

Exactly one of before_comment (move the rule to appear immediately before the EXISTING rule with this comment) or position (move the rule to this 0-based index among the OTHER rules - a value at or beyond the end of that list moves it to the very end) must be given.

WRITE tool, guarded: blocked entirely unless the server is running with MIKROTIK_ALLOW_WRITE=true. Call with confirm=False (the default) to get a before/after preview (the rule's comment/chain plus its current vs. new position) without changing anything; call again with confirm=True to actually apply it. Errors clearly if no rule matches comment (narrowed by chain), if before_comment is given but matches no rule, or if either still matches more than one rule (AmbiguousResourceError) - never guesses.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNo
commentYes
confirmNo
positionNo
device_nameYes
before_commentNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.11.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: it states the write-guard (MIKROTIK_ALLOW_WRITE=true), the two-phase confirm flow, the exact non-destructive scope (never creates/edits fields, only reorders), and enumerated error conditions including AmbiguousResourceError with an explicit 'never guesses' guarantee.

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?

Content is front-loaded with the core purpose, then grouped under a SAFE BY DESIGN header and a parameter-rules paragraph. It is dense and longer than average, but nearly every sentence carries distinct operational information, with minimal filler.

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?

For a 6-parameter write tool with no annotations and 0% schema coverage, the description covers resolution, placement, safety guard, confirmation flow, and failure modes. An output schema exists, so return-value detail is not required, and nothing critical for correct invocation is missing.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it does: it defines comment as the resolution key, chain as an optional narrowing filter, before_comment as a target-relative placement, position as a 0-based index with end-of-list semantics, and confirm as the preview/apply switch.

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?

The description opens with a specific verb and resource: 'Reorder an EXISTING firewall filter rule (/ip/firewall/filter move), resolved by its comment.' It explicitly distinguishes itself from siblings by noting the shared resolution logic with enable_firewall_rule/disable_firewall_rule, and clarifies that only position changes, not fields.

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

Usage Guidelines4/5

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

It gives clear conditions: exactly one of before_comment or position must be supplied, and it explains the confirm=False preview vs confirm=True apply flow. It also names the sibling tools sharing resolution logic. It stops short of stating when reordering is preferable to other firewall operations, but usage context is otherwise explicit.

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