Skip to main content
Glama

Check which firewall policy applies

unifi_check_firewall_path
Read-only

Simulate a new source-to-destination connection to get the zone-based firewall verdict (ALLOW, BLOCK, or REJECT) from ordered policies, including uncertain first matches; no traffic is sent.

Instructions

Read-only "what if": for a new connection from source to destination (and destination port), work out the source and destination zones from the networks' subnets (addresses outside every local subnet are in the External zone), then walk the enabled zone-based firewall policies between those zones in index order and report the first that matches, so the verdict (ALLOW, BLOCK or REJECT). Policies that might match first but can't be evaluated from addresses (apps, domains, regions, IP or port groups, schedules) are listed under may_match_first, and when one of them is listed the verdict is only certain if it doesn't match. Traffic rules that match the source and destination are listed too. It reads the configuration only: no traffic is sent, and the controller's own evaluation can differ in details. Network 9.0+ (zone-based firewall).

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": {
      "source": "<source>",
      "destination": "<destination>"
    },
    "name": "unifi_check_firewall_path"
  }
}

Input Schema

NameRequiredDescriptionDefault
portNoDestination port (tcp/udp). Without it, policies that match specific ports are reported as may_match_first.
siteNoSite name/ID as used in the API (e.g. 'default'). Defaults to the configured site. See unifi_list_sites.
sourceYesSource IP address, or the MAC address of a connected client
protocolNoProtocol (default tcp)
destinationYesDestination IP address, or the MAC address of a connected client
source_zone_idNoUse this zone for the source instead of working it out (v2 _id from unifi_list_firewall_zones), e.g. the Gateway zone
destination_zone_idNoUse this zone for the destination instead of working it out, e.g. the Gateway zone for the gateway's own services

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description adds substantial context beyond them: no traffic is sent, controller evaluation may differ in details, policies are walked in index order, uncertainties are surfaced under may_match_first, and zone derivation from subnets places off-subnet addresses in External. That is a rich disclosure of evaluation behavior; it stops short of describing the shape of the returned verdict object, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the purpose and the verdict outcome, then layers the caveats about may_match_first and non-sent traffic. It is a single dense run-on paragraph, so a reader must parse carefully, but nearly every clause carries information an agent needs.

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?

With no output schema, the description must explain the return values and does: the verdict, the may_match_first list and its meaning for certainty, and matching traffic rules. Combined with the version note and the read-only caveat, an agent has everything needed to call and interpret it.

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

Parameters3/5

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

Schema coverage is 100%, so the baseline is 3. The description adds some meaning, notably how zones are derived from subnets and that off-local addresses fall into External, which explains the source_zone_id/destination_zone_id overrides. It does not add format or syntax detail beyond what the schema already documents for source, destination, port, and protocol.

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?

States a specific verb and resource: a read-only "what if" that resolves zones and walks enabled zone-based firewall policies to produce an ALLOW/BLOCK/REJECT verdict. It is clearly distinguishable from sibling list/get tools such as unifi_list_firewall_policies or unifi_get_firewall_policy_ordering without opening any schema.

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?

Gives clear context for when to use it: simulating a new connection from source to destination and port under the zone-based firewall (Network 9.0+). It does not explicitly route the agent to an alternative for merely inspecting policy configuration, but the use case is concrete enough that the gap is minor.

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