Skip to main content
Glama

unifi_reorder_firewall_policies

DestructiveIdempotent

Reorder a zone pair's user-defined firewall policies by listing them before or after system-defined rules; previews the change unless confirm is true.

Instructions

Set the order of a zone pair's user-defined policies (official PUT /firewall/policies/ordering). Name every user-defined policy of the pair exactly once, by id or name, in beforeSystemDefined or afterSystemDefined. Always needs confirm: true; without it the tool previews the order before → after. System-defined policies can't be moved, and a pair holding IPS auto-blocks (no id in the API) can't be reordered here.

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": {
      "sourceZone": "<sourceZone>",
      "destinationZone": "<destinationZone>",
      "beforeSystemDefined": "<beforeSystemDefined>"
    },
    "name": "unifi_reorder_firewall_policies"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteNoSite name, id or reference; optional while the console has a single site
confirmNoMust be true to carry out a guarded change; without it the tool only previews it
sourceZoneYesSource zone name or id
destinationZoneYesDestination zone name or id
afterSystemDefinedNoPolicies evaluated after the system-defined ones, in order
beforeSystemDefinedYesPolicies evaluated before the system-defined ones, in order

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already flag destructiveHint and idempotentHint, and the description adds meaningful context beyond them: the confirm gate and its preview-only fallback, the underlying API endpoint, and two hard preconditions for reordering. It stops short of saying what could go wrong operationally (e.g. that reordering changes packet evaluation order and can break connectivity), which the destructiveHint implies but does not explain.

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?

Three tight sentences with the operation and its guard behavior front-loaded, and no filler. The middle sentence packs several requirements together, but each one is load-bearing and the ordering is logical.

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 destructive, guarded mutation with no output schema, the description covers the confirm/preview mechanism, required coverage of the policy set, and the two exclusion cases, which is close to sufficient. It leaves unclear how the call fails when the named set doesn't exactly match the pair's policies, which is the most likely misuse path.

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

Parameters3/5

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

Schema coverage is 100%, so the baseline is 3; the description does add value by saying identifiers may be 'id or name' and that each policy must appear exactly once. However, it frames beforeSystemDefined and afterSystemDefined as interchangeable choices ('in beforeSystemDefined or afterSystemDefined') while the schema marks beforeSystemDefined as required, which could lead an agent to omit a required field.

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 order of a zone pair's user-defined policies') and pins it to the official PUT /firewall/policies/ordering endpoint. This clearly separates it from siblings like unifi_update_firewall_policy (which edits policy content) and unifi_set_firewall_policy_enabled (which toggles state).

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?

Gives strong when-it-works context: every user-defined policy of the pair must be named exactly once, system-defined policies can't be moved, and pairs holding IPS auto-blocks can't be reordered here. It doesn't name an alternative tool for the unsupported IPS-auto-block case, so the agent is left to guess where to go instead.

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