Skip to main content
Glama

create_nat_rule

Creates source or destination NAT rules on MikroTik devices with address, port, protocol, interface, and ordering options.

Instructions

Creates a NAT rule (srcnat or dstnat) on the MikroTik device.

Notes: 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" place_before: rule number or ID (*N) to insert before e.g. "0" or "*3"

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

Input Schema

NameRequiredDescriptionDefault
logNo
chainYes
actionYes
deviceNo
commentNo
disabledNo
dst_portNo
protocolNo
src_portNo
to_portsNo
log_prefixNo
dst_addressNo
src_addressNo
in_interfaceNo
place_beforeNo
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

C2.9/5.0
Behavior3/5

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

Annotations already cover the safety profile (not read-only, not destructive, not idempotent, closed-world), so the description only needs to add context. The notes on to_addresses/to_ports formats and place_before insertion semantics are genuinely useful additions, but they are purely argument syntax rather than behavior. Nothing is said about whether the rule takes effect immediately, what happens on conflicting rules, or how a duplicate submission behaves.

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 with the purpose in one sentence, followed by a compact bullet list of the non-obvious formats. No filler, though the note list is selective rather than organized around required vs optional arguments.

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 creation tool with zero schema descriptions, the definition is under-specified: only 3 of 17 parameters receive any explanation, and the two required parameters get none. An output schema exists, so return values need not be described, but an agent still lacks enough information to choose an action or populate the address/interface filters correctly.

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%, so the description carries the full burden across 17 parameters, yet it explains only three (to_addresses, to_ports, place_before). The required parameters chain and action get no semantic explanation — the valid action values (masquerade, src-nat, dst-nat, netmap, etc.) and the meaning of src_address/dst_address/protocol/in_interface/out_interface/log_prefix are entirely undocumented. The format examples it does give are helpful but leave the majority of parameters opaque.

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: 'Creates a NAT rule (srcnat or dstnat) on the MikroTik device.' The NAT scope distinguishes it from create_filter_rule / create_raw_rule siblings, though no sibling is named explicitly.

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?

No when-to-use or when-not guidance, no prerequisites (device selection, permissions), and no mention that NAT rules are order-dependent and position is controlled by place_before. The agent must infer all of this. It also never points at update_nat_rule or move_nat_rule for modifying existing rules.

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