Skip to main content
Glama

get_port_forwards

Read-only

Retrieve all port forwarding rules for a UniFi site to audit mappings and find rule IDs before modifying or deleting forwards.

Instructions

Get all port forwarding rules for a site.

Read-only operation: returns each rule mapping an external port+protocol to an internal IP+port on the gateway. Use this to audit forwards and to find a rule id before delete_port_forward, or create_port_forward to add one.

Args: site: Site to operate on. Defaults to "default". device: Optional console name to target a specific UniFi device; omit for default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoSite to operate on. Defaults to "default".default
deviceNoOptional console name to target a specific UniFi device; omit for default.
Install Server

TDQS

A4.4/5.0
Behavior4/5

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

The description adds meaningful behavioral context beyond the readOnlyHint annotation by specifying exactly what is returned (mapping of external port/protocol to internal IP/port on the gateway). It frames the tool as an audit operation, which further clarifies expected behavior.

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?

The description is compact and well-structured: a one-line purpose, a brief behavioral/return explanation, a usage pointer, and a clear Args section. Every sentence adds functional value without unnecessary fluff.

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 simple read-only list tool with only two optional parameters and no output schema, the description covers purpose, return shape, and usage workflow. It could add more detail about error cases or exact output format, but nothing essential is missing for calling it correctly.

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 parameter descriptions in the text mirror the schema exactly. The description does not add meaningful semantic detail beyond what the schema already provides, so the baseline of 3 applies.

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 ('Get all port forwarding rules for a site') and explains what a rule contains (external port/protocol to internal IP/port mapping. This clearly distinguishes it from sibling tools like create_port_forward and delete_port_forward.

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

Usage Guidelines5/5

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

Explicitly says when to use the tool: to audit forwards and to find a rule id before delete_port_forward, and points to create_port_forward as the complementary operation. This gives the agent concrete routing guidance relative to siblings.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mikeholownych/unifi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server