Skip to main content
Glama

add_firewall_rule

Adds a MikroTik firewall filter rule with matching conditions, actions, and placement before an existing rule ID to prevent dead rules after a final drop.

Instructions

Add a firewall filter rule.

Order decides everything in a RouterOS firewall: the first matching rule wins. A new rule appended after a final drop is dead code, so set place_before unless the end of the chain is genuinely what you want.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
logNo
chainYes'input', 'forward', 'output', or a custom chain.
actionYesWhat to do with matching traffic.
commentNoStrongly recommended — an uncommented rule is very hard to audit later.
disabledNoAdd the rule disabled, to position it before it takes effect.
dst_portNo
protocolNo
src_portNo
log_prefixNo
dst_addressNo
src_addressNo
in_interfaceNo
place_beforeNoRule 'id' to insert before. Without it the rule lands at the end of the list, which for a chain ending in a drop rule usually means it never matches.
out_interfaceNo
connection_stateNoComma-separated, e.g. 'established,related'.
dst_address_listNo
src_address_listNo
in_interface_listNo
out_interface_listNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations only indicate openWorldHint=false, idempotentHint=false, destructiveHint=false, so no readOnly hint. The description discloses that firewall ordering is first-match-wins and warns about the dead-code consequence of poor placement. This goes beyond annotations by explaining the behavioral impact of rule position, which is critical for correct usage.

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

Conciseness5/5

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

The description is exceptionally concise: two short paragraphs. It front-loads the core purpose, then delivers the critical ordering guidance with a concrete example ('appended after a final drop'). Every sentence adds value, and there is no fluff or repetition.

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?

Given the tool's complexity (19 parameters), the description covers the most important risk (ordering) but leaves many parameter semantics unexplained. It does not mention what the return value looks like (though an output schema exists) or how to construct a rule beyond the ordering advice. The agent would need to rely heavily on schema descriptions and domain knowledge for the rest, which is incomplete at 32% coverage.

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

Parameters2/5

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

Schema description coverage is only 32%, and many parameters (dst_port, src_port, protocol, addresses, interfaces, etc.) have no descriptions in the schema. The tool description only addresses place_before, explaining its purpose and default behavior. It does not compensate for the large number of undocumented parameters, leaving the agent to infer semantics from names alone.

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 clearly states the action ('Add a firewall filter rule') with a specific verb and resource. It distinguishes itself from sibling tools like add_nat_rule by explicitly mentioning 'firewall filter rule', and from update/remove/move tools by the verb 'Add'. The additional context about rule ordering further clarifies its purpose in the firewall context.

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?

The description gives explicit guidance on when to set place_before, explaining that appending after a final drop makes the rule dead code. This is valuable usage context. However, it does not explicitly state alternatives like 'use update_firewall_rule for existing rules' or when to prefer this over other add tools, though the purpose makes that somewhat implicit.

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