Skip to main content
Glama

unifi_set_firewall_policy_enabled

DestructiveIdempotent

Enable or disable a user-defined UniFi firewall policy, with preview and explicit confirmation when the change could affect protected networks; system policies and IPS auto-blocks are refused.

Instructions

Enable or disable a user-defined firewall policy. Easy unless the policy can reach a protected network; then it needs confirm: true and previews first. System-defined policies and the IPS auto-blocks are refused. A side that is a zone alone reaches every network in it, and UniFi's Internal zone holds every LAN. So a policy on a zone holding a protected network (UNIFI_MCP_PROTECTED_NETWORKS, pi-cluster by default) is confirm-level unless its filters provably exclude it: a NETWORK filter naming only other networks the console has, or IPv4 addresses, ranges or subnets (directly or through an IPv4 traffic matching list) outside the protected subnets. Addresses that overlap a protected subnet are confirm-level in any zone. Anything the guard cannot place leans to confirm: an unknown zone, list or network id, an IPv6 address, an opposite match, or a MAC, port or other filter, which counts as the whole zone.

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": {
      "policy": "<policy>",
      "enabled": "<enabled>"
    },
    "name": "unifi_set_firewall_policy_enabled"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteNoSite name, id or reference; optional while the console has a single site
policyYesPolicy id or exact name
confirmNoMust be true to carry out a guarded change; without it the tool only previews it
enabledYestrue enables, false disables

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations (destructiveHint=true, idempotentHint=true), the description discloses the guarded-change protocol: without confirm the tool only previews, and guarded changes are refused entirely for system-defined policies. It also spells out the evaluative rules for what counts as reaching a protected network, which is behavior an agent cannot infer from 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.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action and the confirm rule are front-loaded, which is good. But the remainder is a dense, run-on block of guard logic ("A side that is a zone alone reaches every network in it...") with a chatty lead-in ("Easy unless..."), making it harder to scan than the underlying rules warrant.

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, guard-gated mutation with no output schema, the description covers the safety model, the preview fallback, and refusal cases thoroughly. It leaves only the preview response shape unstated, a minor gap given the depth of the confirm explanation.

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 baseline is 3, and the description earns above that by explaining the decision logic behind the confirm parameter — zone reach, NETWORK filters, IPv4 ranges, and the conservative fallback for unknown ids, IPv6, opposite matches, and MAC/port filters. It adds genuine meaning beyond the schema's terse "Must be true to carry out a guarded change".

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 first sentence states a specific verb pair and resource: "Enable or disable a user-defined firewall policy." It scopes the target to user-defined policies and explicitly notes that system-defined policies and IPS auto-blocks are refused, which cleanly separates it from the create/update/delete firewall policy siblings.

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 gives extensive when-conditions: plain call when the policy cannot reach a protected network, confirm: true when it can, and an outright refusal for system-defined policies and IPS auto-blocks. It does not name a sibling alternative (e.g. use unifi_update_firewall_policy to change the policy itself), so the routing guidance is contextual rather than complete.

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