Skip to main content
Glama

unifi_create_acl_rule

Destructive

Create a UniFi switch ACL rule to allow or block IPv4 or MAC traffic; protected-network matches require confirm: true, otherwise the change is only previewed.

Instructions

Create a switch ACL rule (official POST /acl-rules). Easy, unless it can match a protected network. A rule that can match a protected network (UNIFI_MCP_PROTECTED_NETWORKS, pi-cluster by default) needs confirm: true: one naming it or an address in its subnet, a network the console does not have, or an endpoint that is open (no filter, ports only, MACs) and so matches any address.

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": {
      "name": "<name>",
      "action": "<action>"
    },
    "name": "unifi_create_acl_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesRule name
siteNoSite name, id or reference; optional while the console has a single site
typeNoIPV4 (default) or MACIPV4
actionYesWhat matched traffic gets
confirmNoMust be true to carry out a guarded change; without it the tool only previews it
enabledNoWhether the rule is active
descriptionNoDescription
sourceFilterNoOfficial ACL endpoint: {type: NETWORKS, networkIds, portFilter?}, {type: IP_ADDRESSES_OR_SUBNETS, ipAddressesOrSubnets, portFilter?} or {type: PORTS, portFilter}; absent matches any
protocolFilterNoProtocols (absent: all)
networkIdFilterNoMAC rules: the network they apply on
destinationFilterNoOfficial ACL endpoint: {type: NETWORKS, networkIds, portFilter?}, {type: IP_ADDRESSES_OR_SUBNETS, ipAddressesOrSubnets, portFilter?} or {type: PORTS, portFilter}; absent matches any
enforcingDeviceFilterNoSwitches that enforce it (absent: all)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already flag a destructive, non-idempotent write. The description adds substantial behavioral detail beyond them: protected-network matching logic, the default UNIFI_MCP_PROTECTED_NETWORKS/pi-cluster guard, and the preview-only behavior when confirm is omitted.

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?

Front-loads the purpose, then explains the guard in two compact sentences. The slightly informal "Easy, unless" phrasing does not waste space or obscure the operation.

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 nested mutation with no output schema, the schema documents all fields and annotations cover the destructive profile; the description fills the critical safety gap around protected networks and confirm. It is sufficient to call correctly, though it could add more about response/preview output and sibling selection.

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 parameter baseline is 3. The description adds non-schema semantics for confirm and for when an open source/destination endpoint (no filter, ports only, MACs) or unknown/protected network triggers the guard.

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?

Names the exact operation and resource: "Create a switch ACL rule", plus the underlying endpoint POST /acl-rules. It is clearly distinct from delete/update siblings by the verb, but does not explain when to choose an ACL rule over firewall policy or other create tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides an important precondition for guarded changes: if a rule may match a protected network, confirm: true is required; without it the tool only previews. It does not state when to use this tool versus sibling create tools such as firewall policy or other alternatives.

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