unifi_create_acl_rule
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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Rule name | |
| site | No | Site name, id or reference; optional while the console has a single site | |
| type | No | IPV4 (default) or MAC | IPV4 |
| action | Yes | What matched traffic gets | |
| confirm | No | Must be true to carry out a guarded change; without it the tool only previews it | |
| enabled | No | Whether the rule is active | |
| description | No | Description | |
| sourceFilter | No | Official ACL endpoint: {type: NETWORKS, networkIds, portFilter?}, {type: IP_ADDRESSES_OR_SUBNETS, ipAddressesOrSubnets, portFilter?} or {type: PORTS, portFilter}; absent matches any | |
| protocolFilter | No | Protocols (absent: all) | |
| networkIdFilter | No | MAC rules: the network they apply on | |
| destinationFilter | No | Official ACL endpoint: {type: NETWORKS, networkIds, portFilter?}, {type: IP_ADDRESSES_OR_SUBNETS, ipAddressesOrSubnets, portFilter?} or {type: PORTS, portFilter}; absent matches any | |
| enforcingDeviceFilter | No | Switches that enforce it (absent: all) |