unifi_block_ip
Block an IPv4 address or CIDR in both inbound and outbound directions on a UniFi network. Adds traffic matching rules so external and internal traffic to or from that address is denied.
Instructions
Block an IPv4 address or CIDR in both directions: adds it to the IPv4 traffic matching list "unifi-mcp blocklist", which "unifi-mcp blocklist inbound" (External → Internal) and "unifi-mcp blocklist outbound" (Internal → External) BLOCK. The first call creates whichever of the three is missing and needs confirm: true once (it previews the creates). After that a block is easy, unless it overlaps a protected network's subnet (UNIFI_MCP_PROTECTED_NETWORKS, pi-cluster by default) or is a wide range (a prefix shorter than /16); those need confirm. An address already listed (x and x/32 are one address) is a no-op.
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": {
"ip": "<ip>"
},
"name": "unifi_block_ip"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes | IPv4 address or CIDR | |
| site | No | Site name, id or reference; optional while the console has a single site | |
| reason | No | Why (echoed back; traffic matching lists have no place to keep it) | |
| confirm | No | Must be true to carry out a guarded change; without it the tool only previews it |