Skip to main content
Glama

create_nat_rule

Create a NAT rule on a Tier-1 gateway's USER NAT section to translate source or destination IPs for SNAT, DNAT, or other NAT actions.

Instructions

[WRITE] Create a NAT rule on a Tier-1 gateway's USER NAT section.

Run list_tier1_gateways for tier1_id and list_nat_rules to avoid an id clash — the same rule_id overwrites. The gateway must have an edge cluster (see create_tier1_gateway) or NAT cannot be realized, and TIER1_NAT advertisement must be set via update_tier1_gateway for the translated address to be reachable from outside. Returns the created rule dict, else {"error", "hint"}. Then confirm with list_nat_rules; delete_nat_rule is the inverse.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNo"DNAT" (default), "SNAT", "REFLEXIVE", "NO_SNAT", "NO_DNAT", or "NAT64".DNAT
targetNoNSX Manager target from config (default if omitted).
rule_idYesUnique ID for the NAT rule.
tier1_idYesGateway ID, as returned by list_tier1_gateways.
source_networkNoSource CIDR (required for SNAT).
translated_networkNoTranslated network/IP (required for all three).
destination_networkNoDestination CIDR (required for DNAT).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv1.8.16
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / action / description
      Added value: +"\"DNAT\" (default), \"SNAT\", \"REFLEXIVE\", \"NO_SNAT\", \"NO_DNAT\", or \"NAT64\"."
    • addedInput schema / properties / action / enum
      Added value: +[
      +  "SNAT",
      +  "DNAT",
      +  "REFLEXIVE",
      +  "NO_SNAT",
      +  "NO_DNAT",
      +  "NAT64"
      +]
    • addedInput schema / properties / destination_network / description
      Added value: +"Destination CIDR (required for DNAT)."
    • addedInput schema / properties / rule_id / description
      Added value: +"Unique ID for the NAT rule."
    • addedInput schema / properties / source_network / description
      Added value: +"Source CIDR (required for SNAT)."
    • addedInput schema / properties / target / description
      Added value: +"NSX Manager target from config (default if omitted)."
    • addedInput schema / properties / tier1_id / description
      Added value: +"Gateway ID, as returned by list_tier1_gateways."
    • addedInput schema / properties / translated_network / description
      Added value: +"Translated network/IP (required for all three)."
  2. Addedv1.8.9
  3. Removedv1.7.6
  4. First observedv1.3.2

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only convey write and non-idempotent hints; the description adds meaningful behavior: the same rule_id overwrites, the gateway must have an edge cluster and TIER1_NAT advertisement for NAT to be realized, and returns the created rule dict or an error shape. This is exactly the kind of context that helps an agent anticipate side effects.

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 front-loaded with the purpose, then provides operational warnings, prerequisites, return expectations, and follow-up steps. Every sentence earns its place, and the length is appropriate for a tool with 7 parameters.

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

Completeness5/5

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

For a create tool with no output schema, it is complete: it explains prerequisites, id-clash behavior, return/error shape, and confirmation step. An agent can confidently invoke and verify the result. Nothing critical is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds value beyond the schema by warning that reusing a rule_id overwrites the existing rule, and by pointing to list_tier1_gateways as the source of tier1_id. That extra meaning justifies a 4.

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 opens with 'Create a NAT rule on a Tier-1 gateway's USER NAT section', which is a specific verb, resource, and scope. It clearly distinguishes itself from sibling create tools like create_static_route and create_segment, and from list_nat_rules/delete_nat_rule.

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

Usage Guidelines4/5

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

It gives concrete prerequisites and workflow: run list_tier1_gateways for tier1_id, run list_nat_rules to avoid an id clash, verify with list_nat_rules, and delete_nat_rule is the inverse. It lacks an explicit 'when not to use' exclusion, but the context is clear.

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