Skip to main content
Glama

create_filter_rule

Creates a firewall filter rule in a specified MikroTik chain to match traffic by addresses, ports, protocol, interfaces, or connection state and apply accept/drop/reject actions.

Instructions

Creates a firewall filter rule in the specified chain on the MikroTik device.

Notes: connection_state: comma-separated e.g. "established,related,new,invalid" limit: RouterOS rate/burst string e.g. "10,5:packet" or "10/1s:packet" tcp_flags: RouterOS flag expression e.g. "syn,!ack" place_before: rule number or ID (*N) to insert before e.g. "0" or "*3" in_interface_list/out_interface_list: name of an /interface list (e.g. "LAN", "WAN") rather than a single interface

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": {
      "chain": "<chain>",
      "action": "<action>"
    },
    "name": "create_filter_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
logNo
chainYes
limitNo
actionYes
deviceNo
commentNo
disabledNo
dst_portNo
protocolNo
src_portNo
tcp_flagsNo
log_prefixNo
dst_addressNo
src_addressNo
in_interfaceNo
place_beforeNo
out_interfaceNo
connection_stateNo
dst_address_listNo
src_address_listNo
in_interface_listNo
out_interface_listNo
connection_nat_stateNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.19.4
    • addedInput schema / properties / in_interface_list
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "In Interface List"
      +}
    • addedInput schema / properties / out_interface_list
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Out Interface List"
      +}
  2. Changed1 schema field changedv0.14.5
    • addedInput schema / properties / device
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Device"
      +}
  3. First observedv0.0.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare the mutation profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), so the bar is lower, but the description adds no operational context: it does not say whether the rule takes effect immediately, whether it is appended at the end of the chain by default, what happens when device is omitted, or what a failed creation returns. The place_before note hints at insertion semantics but is framed as a value format, not as behavior.

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?

Front-loaded single sentence stating the action, followed by a compact Notes block that is scannable and avoids redundancy. Nothing is padding, though the Notes block is a parameter cheat-sheet rather than a structured explanation of the tool.

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?

An output schema exists, so return values need not be explained, but for a 23-parameter mutation tool with zero schema descriptions the definition leaves too much uncovered: most parameters have no meaning documentation and there is no guidance on device targeting or rule ordering defaults. It is enough to attempt a call on the documented fields but not enough to call it reliably in general.

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 0% across 23 parameters, so the description carries the compensation burden. It does add genuinely useful syntax for the non-obvious parameters (connection_state, limit, tcp_flags, place_before, in/out_interface_list), but 17 parameters including addresses, ports, protocol, device, comment, and log remain undocumented anywhere, so compensation is partial.

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 ('Creates a firewall filter rule') plus the scope ('in the specified chain on the MikroTik device'), which lets an agent separate it from update/remove/move siblings. It does not explicitly name an alternative, but the create-vs-modify distinction is clear from the verb.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance: nothing says whether to prefer this over create_raw_rule or create_basic_firewall_setup, nothing about prerequisites such as device selection or privileges, and nothing about ordering implications relative to move_filter_rule. The notes explain value formats rather than usage conditions.

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