Skip to main content
Glama
UniFi Network MCP Server

UniFi Network MCP Server

by owine

List port forwards

unifi_list_port_forwards
Read-only

Lists a site's port forwarding rules from the classic UniFi controller API, showing enabled status, WAN interface, LAN target, and source restrictions to audit internet-exposed services.

Instructions

List the site's port forwards from the classic controller API (rest/portforward), whole and unpaged: each one exposes a LAN host to the internet on the WAN interface pfwd_interface. enabled: false rules forward nothing; enabledCount counts the rest. Unless src_limiting_enabled restricts it to src_firewall_group_id, the forward is open to the whole internet: src is then "any" or absent (Network 11.0.94 omits it). fwd and fwd_port are the LAN target. IDs are the classic controller's _id values.

Input Schema

NameRequiredDescriptionDefault
siteReferenceYesSite internalReference from unifi_list_sites (often default), not the Integration API UUID

Output Schema

NameRequiredDescriptionDefault
dataYes
countYes
enabledCountYes
siteReferenceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.1.0

TDQS

A4/5.0
Behavior5/5

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

Beyond the read-only annotations, the description discloses that results are unpaged, explains how enabled and enabledCount behave, and warns that forwards are exposed to the whole internet unless src_limiting_enabled restricts them. It also notes version-specific behavior where Network 11.0.94 omits src, adding substantial operational context.

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?

The description is dense but front-loaded and every sentence carries useful semantic or security context. It could be slightly easier to scan, but it avoids filler and stays focused on port-forward behavior.

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?

Given the read-only annotations and the presence of an output schema, the description supplies the important contextual caveats an agent needs: unpaged results, classic controller ID semantics, enabled behavior, and source-restriction exposure. Nothing critical for correct invocation is missing.

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 description coverage is 100%, and the schema already explains siteReference as the internalReference from unifi_list_sites. The description mentions 'the site's port forwards' but adds no further meaning for the single parameter beyond what the schema provides.

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?

The description states a specific verb and resource: list the site's port forwards, and identifies the classic controller endpoint rest/portforward. This makes the tool's purpose clear, but it does not explicitly distinguish itself from sibling list tools beyond the resource name.

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?

Usage is implied by the opening 'List the site's port forwards' and the note that results are whole and unpaged. However, there is no explicit when-to-use or when-not-to-use guidance, and no named alternative tool is contrasted.

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