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
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | ||
| comment | Yes | ||
| confirm | No | ||
| position | No | ||
| device_name | Yes | ||
| before_comment | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||