Skip to main content
Glama

create_port_forward

Destructive

Create a port-forwarding rule to map an external WAN port to an internal host and port, making LAN services reachable from the internet. Specify name, internal port, forwarding IP, external port, and protocol.

Instructions

Create a port-forwarding rule that opens an external WAN port and maps it to an internal host/port.

Mutating operation: applied immediately and persisted on the UniFi console. Review existing rules with get_port_forwards first; remove with delete_port_forward. Prefer create_firewall_policy for zone-based/stateful filtering.

Args: name: Unique rule identifier used to find/delete the rule later. dst_port: Internal destination port (1-65535) on the target host. fwd_ip: LAN IP of the internal host receiving forwarded traffic. fwd_port: External listening port (1-65535) on the WAN. proto: IP protocol to forward — "tcp", "udp", or "both". enabled: Whether active on creation. Defaults to True. site: Site to operate on. Defaults to "default". device: Optional device name to target a specific console; omit for default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesUnique rule identifier used to find/delete the rule later.
siteNoSite to operate on. Defaults to "default".default
protoNoIP protocol to forward — "tcp", "udp", or "both".tcp_udp
deviceNoOptional device name to target a specific console; omit for default.
fwd_ipYesLAN IP of the internal host receiving forwarded traffic.
enabledNoWhether active on creation. Defaults to True.
dst_portYesInternal destination port (1-65535) on the target host.
fwd_portYesExternal listening port (1-65535) on the WAN.
Install Server

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only provide destructiveHint: true, but the description adds operational detail: 'Mutating operation: applied immediately and persisted on the UniFi console.' It also surfaces the workflow of reviewing and deleting rules, which is useful context beyond the annotation.

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 well-structured with a clear purpose statement, a prominent mutating-operation warning, and targeted sibling guidance. The Args list is somewhat redundant with the schema, but the overall length is justified and each section is easy to scan.

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?

For an 8-parameter mutating tool with no output schema, the description covers the operation's effect, persistence, related tools, and an alternative. It gives an agent everything needed to decide when to call it and what the result will be.

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%, so the schema already documents every parameter. The description's Args section largely restates the schema rather than adding new meaning, though it usefully distinguishes fwd_port vs dst_port as external vs internal ports.

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 opens with a specific verb and resource: 'Create a port-forwarding rule that opens an external WAN port and maps it to an internal host/port.' It clearly distinguishes this tool from related siblings by name-checking create_firewall_policy, get_port_forwards, 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?

The description explicitly instructs the agent to review existing rules with get_port_forwards first, to remove rules with delete_port_forward, and to prefer create_firewall_policy for zone-based/stateful filtering. This gives clear decision criteria for selecting this tool over alternatives.

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