Skip to main content
Glama

create_port_forward

Creates a port forwarding rule on a UniFi site by mapping an external port to an internal IP and port, enabling remote access to devices on the network.

Instructions

Create a port forwarding rule via the Classic REST API.

host: console name, ID, or composite ID (MAC:numericId format). site: site name or ID. payload: port forward config. Required fields (validated locally — a missing field raises ValueError naming it): name, dst_port, fwd, fwd_port. proto is optional (the controller defaults it, typically 'tcp_udp'). This Classic REST endpoint enforces no required fields server-side (verified live: it accepts an empty body and silently creates a broken rule), so the local check is the only guard. Example: {"enabled": true, "name": "SSH", "pfwd_interface": "wan", "src": "any", "dst_port": "2222", "fwd": "192.168.1.10", "fwd_port": "22", "proto": "tcp", "log": false}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes
siteYes
payloadYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Install Server

TDQS

A4.4/5.0
Behavior5/5

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

The description makes critical behavioral details transparent: the local validation of required fields, the fact that the server-side endpoint enforces no required fields, and that an empty body would silently create a broken rule. It also notes the proto default. This is excellent risk disclosure, especially with no annotations provided.

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 well-structured and front-loaded: purpose, parameter definitions, behavioral warning, and a concrete example. Every sentence provides necessary information without filler. Despite being detailed, it remains efficient and scannable.

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?

The description covers all essential invocation details: how to specify host/site, the required payload structure, the important server-side validation gap, and a realistic example. Since an output schema exists, not detailing return values is acceptable. This is highly complete for a create operation with a nested object payload.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden. It defines host, site, and payload semantics, lists the required payload fields (name, dst_port, fwd, fwd_port), explains that proto is optional with a default, and gives a complete example. This fully compensates for the schema's lack of description.

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?

The description clearly states the tool's action: 'Create a port forwarding rule via the Classic REST API.' It specifies the verb (create), the resource (port forwarding rule), and the API context. This distinguishes it from sibling CRUD tools like update_port_forward and delete_port_forward based on the verb alone.

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

Usage Guidelines2/5

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

There is no explicit guidance on when to use this tool versus alternatives. The description does not mention update_port_forward, delete_port_forward, or list_port_forwards, nor does it provide conditions for choosing this tool. The 'create' verb implicitly suggests usage for new rules, but the description leaves that to inference.

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/swkstudios/unifi-fabric-mcp-server'

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