Skip to main content
Glama
unifi-mcp-server

unifi-mcp-server

by PainInTheNic

Create Firewall Policy

unifi_create_firewall_policy
Destructive

Creates a zone-based UniFi firewall policy to enforce ALLOW, BLOCK, or REJECT rules between source and destination zones. Confirm live-traffic changes with the user first.

Instructions

Create a zone-based firewall policy. 'config' is the full policy object; required: name, enabled, action (ALLOW/BLOCK/REJECT), source, destination, ipProtocolScope, loggingEnabled. Model it on an existing policy fetched via unifi_get_firewall_policy. CAUTION: a new ALLOW/BLOCK policy changes live traffic filtering — confirm with the user.

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": {
      "config": "<config>"
    },
    "name": "unifi_create_firewall_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
configYesFull firewall policy object. Required: name, enabled, action, source, destination, ipProtocolScope, loggingEnabled. See unifi_get_firewall_policy for the shape. 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the mutation risk is structurally signposted; the description usefully adds that a new ALLOW/BLOCK policy 'changes live traffic filtering' and requires user confirmation, plus the redaction-refusal rule. It still does not say whether the change is reversible or how quickly it takes effect on live traffic.

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: purpose, construction guidance, then the risk warning, in a sensible front-loaded order. The required-field enumeration is somewhat redundant with the schema but not wasteful.

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?

A destructive nested-object mutation with no output schema is handled reasonably: required fields, a reference tool for the object shape, and a confirmation caution are all present. Effect timing and error/refusal behavior beyond redaction are the remaining gaps.

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 required-field list and siteId auto-selection are already documented in the schema; the description largely restates them. The only marginal addition is the referenced modeling tool, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ('Create a zone-based firewall policy') that clearly separates it from the update/delete/get siblings. It does not explicitly name a sibling it might be confused with, but the create scope is unambiguous.

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 a concrete construction path ('Model it on an existing policy fetched via unifi_get_firewall_policy') and a confirmation precondition ('confirm with the user'). It lacks explicit when-not-to-use guidance versus unifi_update_firewall_policy, but the create context is clear.

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