Skip to main content
Glama

add_nat_rule

Add NAT rules to enable port forwarding or masquerade by setting chain, action, and target addresses for MikroTik routers.

Instructions

Add a NAT rule, such as a port forward.

A port forward also needs the forward chain to permit the traffic; check list_firewall_rules(chain='forward') for a rule accepting connection-nat-state=dstnat before concluding it is broken.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainYes'dstnat' for a port forward, 'srcnat' for masquerade.
actionYes'dst-nat' for port forwards, 'masquerade' for outbound NAT.
commentNo
disabledNo
dst_portNo
protocolNo
to_portsNoDestination port for dst-nat, e.g. '8080'.
dst_addressNo
src_addressNo
in_interfaceNo
to_addressesNoDestination for dst-nat, e.g. '192.168.88.50'.
out_interfaceNo
in_interface_listNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

The description adds valuable behavior beyond the annotations: it warns that a port forward alone may not work unless the forward chain permits dstnat traffic, and directs the user to check list_firewall_rules before troubleshooting. This is context not captured by idempotentHint, destructiveHint, or openWorldHint, and it helps set proper expectations after the call.

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 compact, front-loaded with the core purpose, and every sentence earns its place. The second sentence adds a high-value troubleshooting note about the forward chain precondition without bloat.

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 mutation tool with 13 parameters and a low schema coverage, the description is incomplete. It does not explain the required parameters' roles, common combos, or the effect of omitting optional fields. While the output schema covers return values, the description leaves too much operational context to inference.

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?

The description provides almost no parameter-level guidance; it only mentions 'port forward' generically. With 13 parameters and only 31% schema description coverage, the description needed to compensate by explaining key fields like dst_address, in_interface, protocol, and to_ports, but it does not. The schema's few descriptions carry the entire parameter-semantics burden.

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 tool adds a NAT rule, with 'port forward' as an example. This distinguishes it from sibling tools like add_firewall_rule because the resource is explicitly a NAT rule, not a firewall rule. The verb 'Add' plus the resource gives a specific, unambiguous purpose.

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 description conveys the primary use case (adding a NAT rule, especially a port forward) and adds a useful follow-up check about the forward chain. However, it does not explicitly contrast this tool with alternatives like add_firewall_rule or remove_nat_rule, nor does it state when not to use it.

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