Skip to main content
Glama

update_filter_rule

Idempotent

Modify an existing MikroTik firewall filter rule by rule ID, updating fields such as chain, action, addresses, ports, protocol, and connection state.

Instructions

Updates an existing firewall filter rule on the MikroTik device.

Notes: rule_id: positional number from list output (e.g. "12") or internal ID (e.g. "*1A") connection_state: comma-separated e.g. "established,related" limit: RouterOS rate string e.g. "10,5:packet" tcp_flags: RouterOS flag expression e.g. "syn,!ack" Pass "" to clear an optional field (e.g. src_address="").

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": {
      "rule_id": "<rule_id>"
    },
    "name": "update_filter_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
logNo
chainNo
limitNo
actionNo
deviceNo
commentNo
rule_idYes
disabledNo
dst_portNo
protocolNo
src_portNo
tcp_flagsNo
log_prefixNo
dst_addressNo
src_addressNo
in_interfaceNo
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

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly=false, idempotent=true, destructive=false, and openWorld=false, so safety is partly covered. The description adds genuinely useful behavior beyond that: optional fields can be cleared by passing an empty string (a semi-destructive, non-obvious effect), and it documents the accepted rule_id forms. It omits what happens to parameters left null (unchanged vs. reset), which is the key update semantic.

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?

The lead sentence states the action first, followed by a compact, well-formatted notes block where each line covers one concrete detail. Slightly more could be trimmed, but no sentence is wasted.

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 no explanation, and the clearing convention plus rule_id format cover the biggest pitfalls. For a 23-parameter mutation tool, though, the description never explains partial-update semantics, device selection, or how rule_id must come from a prior list call, leaving gaps an agent could hit.

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 a heavy burden and addresses only four of them (rule_id, connection_state, limit, tcp_flags) plus the clear-with-empty-string convention. Those notes add real value for the tricky RouterOS string formats, but the majority of parameters (action, chain, addresses, interface lists, NAT state) get no meaning beyond their names.

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?

States a specific verb and resource ('Updates an existing firewall filter rule') and scopes it to the MikroTik device, so an agent can distinguish it from create_filter_rule or the ipv6/raw variants by name alone. It does not explicitly name a sibling as the alternative, keeping it below a 5.

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

Usage Guidelines3/5

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

Usage is implied by 'existing' rule and by the rule_id note (obtain the ID from list output), which tells the agent prerequisite data. However there is no explicit when-to-use/when-not guidance versus create_filter_rule, update_ipv6_filter_rule, or move_filter_rule, so routing is left to inference.

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