Skip to main content
Glama

update_firewall_rule

Destructive

Modify an existing UniFi firewall rule by specifying its ID and the fields to change. Only provided attributes are updated and applied instantly.

Instructions

Update a legacy firewall rule. Only provided fields are changed.

Mutating operation: applied immediately and persisted on the controller. Use get_firewall_rules to find the rule ID first.

Args: rule_id: Firewall rule ID (from get_firewall_rules) name: New rule name action: Action — "accept", "drop", or "reject" protocol: Protocol — "tcp", "udp", "icmp", "all", or IANA number dst_port: Destination port or range src_zone: Source zone ID dst_zone: Destination zone ID src_port: Source port or range logging: Enable/disable logging enabled: Enable/disable the rule site: Site to operate on. Defaults to "default". device: Optional console name to target a specific console; omit for default.

Returns: Updated firewall rule configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoNew rule name.
siteNoSite to operate on. Defaults to "default".default
actionNoAction — "accept", "drop", or "reject"
deviceNoOptional console name to target a specific UniFi device; omit for default.
enabledNoEnable/disable the rule.
loggingNoEnable/disable logging.
rule_idYesFirewall rule ID (from get_firewall_rules).
dst_portNoDestination port or range.
dst_zoneNoDestination zone ID.
protocolNoProtocol — "tcp", "udp", "icmp", "all", or IANA number
src_portNoSource port or range.
src_zoneNoSource zone ID.
Install Server

TDQS

A4.2/5.0
Behavior4/5

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

With only destructiveHint=true as an annotation, the description adds meaningful behavior: it states the operation is 'Mutating operation: applied immediately and persisted on the controller.' It also clarifies partial-update semantics so the agent knows unspecified fields are not overwritten. This goes beyond the annotation by explaining persistence and update scope.

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 description is well-organized and front-loads the most important information. However, the Args section largely repeats the schema's per-parameter descriptions, adding length without much extra value. It is readable but not as tight as it could be.

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 12-parameter mutation tool with no output schema, the description covers the essential context: prerequisite lookup, partial-update behavior, persistence, and a minimal return description. It could be more complete about failure modes or exact return structure, but nothing critical is missing for selecting or invoking the tool.

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?

The input schema already describes every parameter, so the baseline is met. The description adds the critical semantic that 'Only provided fields are changed,' which is essential for understanding how optional parameters behave. The Args list mostly duplicates the schema, but the partial-update statement gives parameter behavior not present in the schema.

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 uses a specific verb ('Update') and a clear resource ('firewall rule'), and further specifies 'legacy firewall rule' and partial-update behavior ('Only provided fields are changed'). This distinguishes it from sibling tools like create_firewall_rule, delete_firewall_rule, and firewall policy tools without needing to inspect their schemas.

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 a concrete prerequisite: 'Use get_firewall_rules to find the rule ID first.' It also implies when to use the tool—modifying an existing legacy firewall rule—and contrasts with create/delete operations through the partial-update wording. It does not explicitly name alternatives such as create_firewall_rule or delete_firewall_rule, but the context is clear enough.

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/mikeholownych/unifi-mcp'

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