Skip to main content
Glama

delete_nat_rule

Remove a NAT rule from a Tier-1 gateway in VMware NSX to manage network address translation configurations.

Instructions

Delete a NAT rule from a Tier-1 gateway.

Args: tier1_id: The Tier-1 gateway ID. rule_id: The NAT rule ID to delete. target: Optional NSX Manager target name from config. Uses default if omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tier1_idYes
rule_idYes
targetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual implementation of the delete_nat_rule function that executes the API call to delete a NAT rule on a Tier-1 gateway.
    def delete_nat_rule(
        client: NsxClient,
        tier1_id: str,
        rule_id: str,
    ) -> dict:
        """Delete a NAT rule from a Tier-1 gateway.
    
        Args:
            client: Authenticated NSX API client.
            tier1_id: Tier-1 gateway identifier.
            rule_id: NAT rule identifier to delete.
    
        Returns:
            Dict with deletion status.
        """
        _validate_id(tier1_id)
        _validate_id(rule_id)
    
        path = (
            f"/policy/api/v1/infra/tier-1s/{tier1_id}"
            f"/nat/USER/nat-rules/{rule_id}"
        )
        client.delete(path)
        _log.info("Deleted NAT rule %s from Tier-1 %s", rule_id, tier1_id)
        return {"deleted": True, "tier1_id": tier1_id, "rule_id": rule_id}
  • The MCP tool registration and wrapper function for deleting a NAT rule. Note: The import in this file is listed as 'vmware_nsx.ops.nat_mgmt', however the search revealed the code is in 'vmware_nsx.ops.nat_route_mgmt'. It appears 'vmware_nsx/ops/nat_mgmt' may be an alias or misdirection, but the functional implementation is in 'nat_route_mgmt.py'.
    def delete_nat_rule(
        tier1_id: str,
        rule_id: str,
        target: str | None = None,
    ) -> str:
        """Delete a NAT rule from a Tier-1 gateway.
    
        Args:
            tier1_id: The Tier-1 gateway ID.
            rule_id: The NAT rule ID to delete.
            target: Optional NSX Manager target name from config. Uses default if omitted.
        """
        from vmware_nsx.ops.nat_mgmt import delete_nat_rule as _delete
    
        client = _get_connection(target)
        _delete(client, tier1_id, rule_id)
        return f"NAT rule '{rule_id}' deleted from '{tier1_id}'."
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only minimally satisfies it. While it notes the default behavior for the 'target' parameter, it fails to disclose critical safety information: that deletion is destructive/permanent, error handling if the rule doesn't exist, or required permissions.

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 description is appropriately sized with a clear front-loaded purpose statement followed by a structured Args section. The docstring format is slightly verbose but acceptable; every element serves a necessary function without redundant filler.

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?

For a three-parameter deletion tool with an existing output schema, the description adequately covers the input parameters and action. However, gaps remain regarding behavioral context (destructive confirmation, idempotency, error states) that annotations would typically cover but are absent here.

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?

Given the schema has 0% description coverage (titles only), the Args section effectively compensates by documenting all three parameters with sufficient semantics: tier1_id and rule_id are identified as IDs, and target is explained as an optional NSX Manager target with default fallback behavior.

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 specific action (Delete), resource (NAT rule), and scope (from a Tier-1 gateway), effectively distinguishing it from sibling tools like create_nat_rule, list_nat_rules, and other delete_* operations.

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?

The description provides no guidance on when to use this tool versus alternatives (e.g., when to delete vs update), nor does it mention prerequisites such as verifying the rule exists first or the irreversible nature of the operation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zw008/VMware-NSX'

If you have feedback or need assistance with the MCP directory API, please join our Discord server