Skip to main content
Glama
lucamarien

OPNsense MCP Server

by lucamarien

opn_add_firewall_rule

Create firewall filter rules with automatic rollback protection. Rules revert in 60 seconds unless changes are confirmed.

Instructions

Create a new MVC firewall filter rule with savepoint protection.

Use this when you need to add a firewall rule. Changes auto-revert in 60 seconds unless confirmed with opn_confirm_changes.

IMPORTANT: This creates MVC rules (Settings > Firewall > Automation), not legacy GUI rules.

Parameters:

  • action: 'pass', 'block', or 'reject'

  • direction: 'in' or 'out'

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

  • ip_protocol: 'inet' (IPv4), 'inet6' (IPv6), or 'inet46' (dual-stack)

  • protocol: 'any', 'TCP', 'UDP', 'TCP/UDP', 'ICMP', etc.

  • source_net: source address/network or 'any'

  • source_not: invert source match (True = NOT source_net)

  • source_port: source port number or range, or empty for any

  • destination_net: destination address/network or 'any'

  • destination_not: invert destination match (True = NOT destination_net, e.g. !Private_Networks)

  • destination_port: port number or range (e.g. '80', '1000-2000'), or empty for any

  • gateway: force traffic via specific gateway (e.g. 'WAN_GW') for policy routing, or empty for default

  • log: enable logging for this rule (default: off)

  • quick: first-match wins (default: True). Set False for last-match-wins logic

  • sequence: rule ordering within priority group (default: 1, higher = later)

  • categories: comma-separated category UUIDs to assign to this rule

  • description: human-readable rule description

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNopass
directionNoin
interfaceNolan
ip_protocolNoinet
protocolNoany
source_netNoany
source_notNo
source_portNo
destination_netNoany
destination_notNo
destination_portNo
gatewayNo
logNo
quickNo
sequenceNo
categoriesNo
descriptionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations are provided, so the description fully covers behavioral traits. It discloses auto-revert in 60 seconds unless confirmed, the MVC vs legacy distinction, parameter meanings including inverted logic, and the return structure (dict with revision, uuid, result). This provides complete transparency for a complex tool.

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: an introductory sentence, usage context, a critical distinction, then a detailed parameter list. Every sentence adds value, and the structure aids readability. Although lengthy, it is not wasteful and appropriately front-loads key information.

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 17 parameters, no schema coverage, no annotations, and an output schema, the description covers all essential aspects: parameter details, behavioral traits (auto-revert), and return values. It is complete for the tool's complexity and provides all necessary context for correct invocation.

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?

With 0% schema coverage, the description compensates fully by explaining each of the 17 parameters, including defaults, valid values (e.g., action: 'pass', 'block', 'reject'), and examples (e.g., destination_port: '80', '1000-2000'). It adds meaning beyond the schema, such as clarifying special cases like destination_not.

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's purpose: 'Create a new MVC firewall filter rule with savepoint protection.' It uses a specific verb and resource, and distinguishes from siblings by emphasizing MVC rules as opposed to legacy GUI rules.

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?

The description explicitly says 'Use this when you need to add a firewall rule' and mentions the auto-revert and confirmation process. It also notes the important distinction between MVC and legacy rules. However, it could provide more guidance on when not to use it or suggest alternative tools from the sibling list (e.g., opn_add_nat_rule).

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