Skip to main content
Glama
unifi-mcp-server

unifi-mcp-server

by PainInTheNic

Reorder Firewall Policies

unifi_reorder_firewall_policies
DestructiveIdempotent

Reorder user-defined firewall policies for a source→destination zone pair by setting ordered before- and after-system-defined lists; rule order determines what traffic is allowed or blocked.

Instructions

Set the evaluation order of user-defined firewall policies for one source→destination zone pair. The API splits user policies into those evaluated BEFORE the zone's system-defined policies and those AFTER, so pass two ordered lists. Use unifi_get_firewall_policy_ordering (or model on the current order) to see the existing split. CAUTION: order determines which rule wins — reordering changes what traffic is allowed/blocked; confirm with the user. Zone IDs come from unifi_list_firewall_zones; policy IDs from unifi_list_firewall_policies.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sourceFirewallZoneId": "<sourceFirewallZoneId>",
      "destinationFirewallZoneId": "<destinationFirewallZoneId>",
      "beforeSystemDefined": "<beforeSystemDefined>",
      "afterSystemDefined": "<afterSystemDefined>"
    },
    "name": "unifi_reorder_firewall_policies"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteIdNoSite ID (UUID from unifi_list_sites). Optional — when the console has exactly one site it is used automatically.
afterSystemDefinedYesUser-defined policy IDs evaluated AFTER the system-defined policies for this zone pair, in order
beforeSystemDefinedYesUser-defined policy IDs evaluated BEFORE the system-defined policies for this zone pair, in order
sourceFirewallZoneIdYesSource firewall zone ID (from unifi_list_firewall_zones)
destinationFirewallZoneIdYesDestination firewall zone ID (from unifi_list_firewall_zones)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description goes further by explaining the consequence — 'order determines which rule wins — reordering changes what traffic is allowed/blocked'. It also discloses a non-obvious API behavior: user policies are split into lists evaluated before versus after the zone's system-defined policies, which is essential to forming a correct call.

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?

Four sentences, all load-bearing: purpose, the before/after split rule, the inspection step, then the safety caution and ID sourcing. The caution is prominent and the most critical information (the split requirement) comes early rather than buried.

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

Completeness4/5

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

For a destructive ordering mutation with no output schema, the description covers purpose, prerequisites, split semantics, and risk. The only minor gap is that it doesn't say what the call returns or whether the full ordered set must be supplied (versus a partial reorder), but nothing that blocks a correct invocation 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 schema already documents all five parameters, including the before/after SystemDefined lists. The description still adds conceptual value by explaining why two ordered lists exist (the API's split around system-defined policies), which is framing the field descriptions only imply. It does not, however, add format or validation detail beyond the schema.

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?

States a specific verb and resource — 'Set the evaluation order of user-defined firewall policies' — scoped to a 'source→destination zone pair'. This clearly distinguishes it from unifi_list_firewall_policies, unifi_get_firewall_policy_ordering, and unifi_update_firewall_policy without needing to open any schema.

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?

Names the prerequisite tools for each input (unifi_list_firewall_zones for zone IDs, unifi_list_firewall_policies for policy IDs) and routes the agent to unifi_get_firewall_policy_ordering to inspect the current split before writing. It also states an explicit human-in-the-loop condition: 'confirm with the user' before reordering.

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

Deploy Server

Other Tools