Skip to main content
Glama

set_device_port

Destructive

Set a UniFi switch port's native VLAN, PoE mode, name, or enabled state. Requires confirmation before applying to avoid disrupting connected devices.

Instructions

Configure a single switch port: native VLAN, PoE mode, name, or enable state.

Mutating operation: applied immediately and persisted on the console, changing untagged VLAN traffic, PoE delivery, or link state on that port. Only the fields you provide change. Requires confirm=true because a port change can disrupt connectivity for the attached device or downstream network. Use get_device_ports first to find the port_idx and current values.

Args: mac: Device MAC address (case-insensitive; aa:bb:cc:dd:ee:ff or aabbccddeeff). port_idx: Port number to configure (1-based; e.g. 1-24 or SFP 25/26). name: Optional custom port name (e.g. "Cameras"). native_network: Optional network or VLAN name (or its ID) to set as the port's native/untagged VLAN. poe_mode: Optional PoE mode - "auto", "on", "off", or "passv24". forward: Optional VLAN forwarding - "all" (every VLAN) or "customize". enabled: Optional port enable state; True connects, False disables. site: Site to operate on. Defaults to "default". device: Optional device name to target a specific console; omit for default. confirm: Must be True to apply the port change. Defaults to False.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
macYesDevice MAC address (case-insensitive; aa:bb:cc:dd:ee:ff or aabbccddeeff).
nameNoOptional custom port name (e.g. "Cameras").
siteNoSite to operate on. Defaults to "default".default
deviceNoOptional device name to target a specific console; omit for default.
confirmNoMust be True to apply the port change. Defaults to False.
enabledNoOptional port enable state; True connects, False disables.
forwardNoOptional VLAN forwarding - "all" (every VLAN) or "customize".
poe_modeNoOptional PoE mode - "auto", "on", "off", or "passv24".
port_idxYesPort number to configure (1-based; e.g. 1-24 or SFP 25/26).
native_networkNoOptional network or VLAN name (or its ID) to set as the port's native/untagged VLAN.
Install Server

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description discloses that the operation mutates state, is applied immediately, persists on the console, affects untagged VLAN traffic/PoE/link state, is partial ('Only the fields you provide change'), and requires confirm=true because it can disrupt connectivity. This is rich behavioral context that goes well beyond the annotation and helps an agent understand side effects and risk.

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: a one-line summary, a behavioral note, and a clear Args list. It front-loads the purpose and follows with important caveats. The Args section is somewhat repetitive given the schema already describes each parameter identically, adding length without new information, but the overall structure is clear and every section carries useful context. A slight trim would earn a 5.

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 10-parameter mutating tool with only destructiveHint as an annotation and no output schema, the description provides substantial context: prerequisites, side effects, confirmation requirement, and partial-update semantics. It does not describe the response format or error behavior, but the absence of an output schema lowers the expectation. The description covers most of what an agent needs to invoke the tool safely and 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%, so the baseline is 3. The description's Args section largely duplicates the schema parameter descriptions and adds no new semantic meaning beyond what the schema already contains. The prose does clarify the 'only fields you provide change' behavior and the confirm requirement, but these are more behavioral than parameter-specific. The description adds minimal value beyond the fully described schema.

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: 'Configure a single switch port' and enumerates the configurable aspects (native VLAN, PoE mode, name, enable state). It is clearly distinguished from sibling tools like get_device_ports and update_network by focusing on a single port mutation. An agent can immediately understand what this tool does and what it does not do.

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?

The description explicitly advises 'Use get_device_ports first to find the port_idx and current values,' establishing a clear prerequisite. It also explains the confirm=true necessity due to potential connectivity disruption, which guides when to set that flag. However, it does not mention alternative tools or explicitly state when not to use this tool, so it misses the full when/when-not structure for a perfect score.

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