Skip to main content
Glama

update_firewall_policy

Replace a firewall policy by ID with a full new configuration to update traffic filtering rules on a UniFi site.

Instructions

Full-replace a firewall policy by ID.

host: console name, ID, or composite ID (MAC:numericId format). site: site name or ID. policy: full firewall policy configuration to replace with. policy_id: REQUIRED. The policy's id; obtain it from list_firewall_policies (its id field). trafficFilter (optional; may appear on source and/or destination) narrows the match beyond the zone pair. Set trafficFilter.type plus the ONE matching nested object:

  • IP_ADDRESS -> ipAddressFilter.items[] (IP addresses / CIDRs)

  • NETWORK -> networkFilter.networkIds[] (network UUIDs)

  • PORT -> portFilter.items[] (ports / port ranges)

  • MAC_ADDRESS -> macAddressFilter.macAddresses[] (client MAC addresses) The controller may also support further types (e.g. region/identity-based); list_firewall_policies only reveals the types already in use on a site, so an unlisted type is not evidence it is unsupported. PORT-FILTER PLACEMENT FOOTGUN: a portFilter under source.trafficFilter filters SOURCE ports, which for outbound flows are ephemeral (random high ports) -> the rule silently matches nothing. A destination-port rule MUST use destination.trafficFilter with type PORT, never a source portFilter. (create/update_firewall_policy log a runtime warning when a source PORT filter is combined with an any-destination ALLOW.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes
siteYes
policyYes
policy_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Install Server

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden, and it delivers. It explicitly says 'full-replace', which conveys potentially destructive behavior. It discloses the trafficFilter matching semantics and prominently warns about the port-filter placement footgun, including the silent no-match outcome and the runtime warning behavior. This is far more transparent than a generic 'update' description.

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?

Although somewhat long, every sentence is operational and earns its place. The description is front-loaded with the core purpose, then logically structured into parameter definitions, trafficFilter alternatives, and a highlighted footgun warning. Formatting with lists and all-caps warning aids scanning. There is no filler or repetition.

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

Completeness5/5

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

Given the complexity (nested objects, required policy object, zero schema descriptions), the description covers all essential aspects: operation type, parameter formats, how to source the ID, and the critical port-filter trap. The existence of an output schema means return value details need not be included. An agent has enough to invoke the tool correctly, and the pointer to list_firewall_policies helps with the ID.

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

Parameters5/5

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

Schema descriptions are completely absent (0% coverage), so the description is the sole source of parameter meaning. It explains host/site formats, that policy is the full configuration, and exactly how to obtain policy_id from list_firewall_policies. It also details the nested trafficFilter structure, type-by-type with field mappings, fully compensating for the schema's silence.

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 'Full-replace a firewall policy by ID', which clearly identifies the verb, resource, and scope. It explicitly contrasts with patch-style updates by emphasizing 'full-replace', making it distinguishable from the sibling patch_firewall_policy. The key parameters are also named, so an agent immediately knows what the tool does.

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 phrase 'Full-replace' provides implicit guidance that this tool is for complete replacement, implying that a partial update would use patch_firewall_policy. It also gives practical instructions for obtaining policy_id. However, it does not explicitly name alternative tools or state precise conditions for when to choose this over create or patch, leaving some inference to the agent.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/swkstudios/unifi-fabric-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server