Skip to main content
Glama

update_nat_rule

Idempotent

Modify an existing NAT rule on a MikroTik device by rule ID, changing addresses, ports, chain, action, or interfaces. Use it to correct or retarget port forwarding and masquerade rules.

Instructions

Updates an existing NAT rule on the MikroTik device.

Notes: rule_id: use the ID from list output e.g. "*1" or "0" to_addresses: single IP or range e.g. "10.0.0.1" or "10.0.0.1-10.0.0.10" to_ports: single port or range e.g. "8080" or "8080-8090" Pass "" to clear an optional field.

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_nat_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
logNo
chainNo
actionNo
deviceNo
commentNo
rule_idYes
disabledNo
dst_portNo
protocolNo
src_portNo
to_portsNo
log_prefixNo
dst_addressNo
src_addressNo
in_interfaceNo
to_addressesNo
out_interfaceNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.14.5
    • addedInput schema / properties / device
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Device"
      +}
  2. First observedv0.0.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnly=false, idempotent=true, destructive=false, so the safety profile is partly covered. The description adds a real behavioral rule — passing an empty string clears an optional field — but never states whether omitted optional parameters are preserved or reset, which is the most consequential ambiguity for a 16-optional-field update.

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 one-sentence purpose followed by a tight bulleted notes block; nothing is padded. The notes list is scoped and readable, though the 'Pass "" to clear' rule would read better as a general update-semantics statement than a third bullet.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 17-parameter mutation tool with no schema descriptions, the description underspecifies which fields are editable and how partial updates behave. The presence of an output schema removes the need to describe returns, but the input-side gap is too large for the tool's complexity.

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 0% across 17 parameters, so the description carries the full burden, yet it only annotates three (rule_id, to_addresses, to_ports) and gives the empty-string clearing convention. The fourteen remaining fields — chain, action, protocol, src/dst_address, interfaces, log, comment, disabled, device — get no format or meaning guidance.

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 first sentence gives a specific verb and resource ('Updates an existing NAT rule on the MikroTik device'), which cleanly separates it from create_nat_rule and remove_nat_rule. It never names those siblings explicitly, so differentiation is implied rather than stated.

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?

The phrase 'existing NAT rule' plus the rule_id note ('use the ID from list output') implicitly routes the agent through list_nat_rules before calling this tool. There is no explicit statement of when to prefer update over create/disable/enable, and no prerequisites or exclusions.

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