Skip to main content
Glama
unifi-mcp-server

unifi-mcp-server

by PainInTheNic

Update Firewall Policy

unifi_update_firewall_policy
DestructiveIdempotent

Replace an existing user-defined UniFi firewall policy with a full updated configuration to change live traffic filtering rules; confirm the target policy before applying.

Instructions

Replace a user-defined firewall policy (full PUT). Fetch the current object with unifi_get_firewall_policy, modify it, and pass it as 'config' (system-defined policies cannot be edited). CAUTION: this changes live traffic filtering — confirm with the user and double-check WHICH policy. For a simple enable/disable use unifi_set_firewall_policy_enabled instead. IDs come 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": {
      "policyId": "<policyId>",
      "config": "<config>"
    },
    "name": "unifi_update_firewall_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
configYesFull firewall policy object to write (fetch current via unifi_get_firewall_policy, then modify). A config with any value still containing "[redacted]" (how reads show credentials) is refused: put the real value in, or leave the field out.
siteIdNoSite ID (UUID from unifi_list_sites). Optional — when the console has exactly one site it is used automatically.
policyIdYesFirewall policy ID (UUID from unifi_list_firewall_policies)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=true, so the bar is lower, yet the description adds the crucial PUT semantics (the whole object is replaced), the live-traffic impact, and a confirm-with-the-user instruction. It also discloses the "[redacted]" refusal behavior, which is non-obvious operational context beyond the annotations.

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 paragraph is dense but front-loaded: replacement semantics first, then workflow, then caution, then alternatives. Almost every clause earns its place, though the trailing note about where IDs come from repeats the policyId schema description.

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 mutation with a nested free-form config object and no output schema, the description supplies the workflow, the risk warning, the redaction refusal rule, and sibling routing. The only gap is that it does not say what the call returns or whether the response echoes the written object.

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 three parameters. The description still adds real meaning by explaining that 'config' must be a full object obtained via a get-then-modify cycle rather than a partial patch. The ID-source note duplicates the schema text, which is the only reason this is not a 5.

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 verb plus resource and scope: "Replace a user-defined firewall policy (full PUT)". It immediately separates this tool from siblings by excluding system-defined policies and by naming unifi_set_firewall_policy_enabled as the tool for simple toggles.

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?

It gives an explicit three-step workflow (fetch with unifi_get_firewall_policy, modify, pass as 'config'), states the exclusion (system-defined policies cannot be edited), names the alternative for enable/disable, and points to the ID source. When-to-use and when-not-to-use are both covered.

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