Skip to main content
Glama
lucamarien

OPNsense MCP Server

by lucamarien

opn_update_nat_rule

Update an existing NAT port forwarding rule by UUID, changing only the specified parameters such as target IP, port, or protocol while preserving all other settings.

Instructions

Update an existing NAT port forwarding rule by UUID with savepoint protection where supported.

Use this when you need to change the target IP, port, or other properties of a NAT rule. Only the parameters you provide are changed; all other settings are preserved.

Savepoint protection applies on OPNsense < 26.7 only: there changes auto-revert in 60 seconds unless confirmed with opn_confirm_changes. OPNsense 26.7 removed the savepoint API upstream, so on 26.7+ changes apply immediately and are NOT rolled back automatically. Check opn_mcp_info first: if 'savepoint_support' is false, take a config backup with opn_download_config before changing rules that could lock you out. Use opn_list_nat_rules first to find the UUID.

Parameters:

  • uuid: NAT rule UUID (from opn_list_nat_rules)

  • interface: source interface (e.g. 'wan', 'opt1')

  • protocol: 'TCP', 'UDP', or 'TCP/UDP'

  • destination_port: external port to forward (e.g. '8080', '3000-3010')

  • target_ip: internal IP address to forward to

  • target_port: internal port

  • description: human-readable description

  • enabled: enable/disable the rule

Returns: dict with 'revision' (str), 'uuid' (str), and 'result' (str).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYes
enabledNo
protocolNo
interfaceNo
target_ipNo
descriptionNo
target_portNo
destination_portNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully discloses behavior: savepoint protection on OPNsense <26.7 with 60-second auto-revert, immediate changes on 26.7+, and the need to take a backup if savepoint_support is false. This adds crucial operational detail beyond the schema.

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 well-structured with clear sections (purpose, usage, parameters, returns) and each sentence adds value. It is detailed yet not redundant, front-loading the core purpose and organizing the rest logically.

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?

Given 8 parameters, no annotations, and the complexity of version-dependent behavior, the description covers all necessary aspects: parameter explanations, savepoint differences, workflow prerequisites, and return type. It is complete and actionable for an agent.

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

Parameters5/5

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

Schema description coverage is 0%, but the description lists every parameter with an explanation, example, or type (e.g., destination_port: '8080', '3000-3010'). This fully compensates for the lack of schema descriptions, giving agents the meaning and acceptable values.

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 updates an existing NAT port forwarding rule by UUID, distinguishing it from add/delete/list operations. It specifies the verb, resource, and identifier method, making the purpose unambiguous.

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

Usage Guidelines5/5

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

The description explicitly explains when to use this tool (to change target IP, port, or properties), notes that only provided parameters are changed, and instructs to use opn_list_nat_rules first and check opn_mcp_info for savepoint support. This provides clear context and prerequisites.

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/lucamarien/opnsense-mcp-server'

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