Skip to main content
Glama

opnsense_apply_firewall_changes

Destructive

Safely apply staged firewall changes with automatic rollback protection, preventing lockout from flawed rules. Verify connectivity and cancel rollback to keep changes permanent.

Instructions

Activate staged firewall changes, with automatic rollback protection.

Requires OPNSENSE_ALLOW_WRITE=true. This wraps OPNsense's savepoint mechanism, which exists because a bad rule can lock you out of the firewall that hosts the API you would need to fix it.

The sequence, in order:

  1. mode='savepoint' -> returns a revision timestamp

  2. make changes -> e.g. opnsense_toggle_firewall_rule

  3. mode='apply' -> with revision=<from step 1>; the firewall will revert to that revision by itself in 60 seconds

  4. verify connectivity -> confirm the firewall is still reachable

  5. mode='cancel_rollback' -> with the same revision; makes the change permanent

Skipping step 5 is safe: the firewall reverts. Skipping step 1 is not: an apply with no savepoint cannot be undone remotely.

mode='revert' rolls back to a revision immediately without waiting.

Args: params (ApplyChangesInput): Validated input containing: - mode (str): 'savepoint', 'apply', 'cancel_rollback' or 'revert' - revision (str): Revision timestamp, required for all modes except savepoint - response_format (ResponseFormat): 'markdown' or 'json'

Returns: str: Text describing what happened and what to do next, or JSON: {"mode": str, "revision": str, "result": str, "next_step": str}

Error Handling: - Returns a write-disabled explanation when OPNSENSE_ALLOW_WRITE is not set - Returns a validation message when revision is missing for a mode that needs it

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations already indicate destructiveHint=true and readOnlyHint=false, but the description goes far beyond by disclosing the savepoint mechanism, the 60-second automatic rollback, the requirement for OPNSENSE_ALLOW_WRITE=true, and the exact sequence including safe/unsafe skips. It also explains error handling for missing permissions or missing revision.

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 long but well-organized with numbered sequence and clear sections (Args, Returns, Error Handling). It is somewhat repetitive between the sequence and the Args list, but given the complexity of the workflow, the length is justified and front-loaded with the core purpose.

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?

The description fully covers the entire life cycle: prerequisites, savepoint, apply, rollback, cancel, and revert. It includes return format details (string or JSON) and error handling for two common failure cases. This is complete given the tool's complexity and the existing schema/annotations.

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?

The schema descriptions for mode, revision, and response_format are already informative, but the description adds critical workflow context: revision comes from mode='savepoint', how it is used in apply/cancel_rollback, and when it is required. This compensates for the 0% schema coverage signal at the top level.

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 a specific action ('Activate staged firewall changes') and clearly identifies the resource ('staged firewall changes'). It also mentions automatic rollback protection, which distinguishes it from related sibling tools like opnsense_toggle_firewall_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?

The description provides a detailed step-by-step workflow and explicitly references opnsense_toggle_firewall_rule as the mechanism for making changes before applying. It also warns about skipping steps. However, it does not explicitly state 'use this instead of X' or give a clear when-not-to-use scenario beyond the workflow itself.

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

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