Skip to main content
Glama

List switch ports

unifi_list_switch_ports
Read-only

List a UniFi switch's ports to inspect link state, speed, PoE, assigned profiles, LLDP neighbors, link aggregation, and per-port overrides for troubleshooting.

Instructions

List a switch's ports with link state, speed, PoE, assigned profile, LLDP neighbours (what is plugged in: chassis ID, description and remote port), link aggregation and any per-port overrides configured on the device.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mac": "<mac>"
    },
    "name": "unifi_list_switch_ports"
  }
}

Input Schema

NameRequiredDescriptionDefault
upNoOnly ports whose link is up (true) or down (false)
macYesMAC address of the switch
siteNoSite name/ID as used in the API (e.g. 'default'). Defaults to the configured site. See unifi_list_sites.
fieldsNoOnly return these fields per item (dot paths, e.g. uplink.name)
searchNoCase-insensitive substring match on names, MACs, IPs and similar

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.9.1
    • addedInput schema / properties / fields / description
      Added value: +"Only return these fields per item (dot paths, e.g. uplink.name)"
    • addedInput schema / properties / search / description
      Added value: +"Case-insensitive substring match on names, MACs, IPs and similar"
  2. First observedv0.8.1

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description still adds real value by disclosing the content of each port record, including LLDP neighbour details (chassis ID, description, remote port) and per-port overrides, which an agent cannot learn from annotations or the input schema. It omits operational context such as whether the switch must be online or whether results are cached.

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?

A single front-loaded sentence with the verb and resource first; nothing is filler. The long parenthetical enumerating returned fields is dense but earns its place because there is no output schema. Splitting the return contents into a short structured list would improve scanability.

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?

With no output schema, the description carries the burden of explaining what comes back, and it does so concretely down to LLDP neighbour sub-fields. All parameters are self-documented in the schema and safety is covered by annotations. Remaining gaps are permissive/error behaviour for an unknown or non-switch MAC, which is a minor omission for a read-only list tool.

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 each of the five parameters carries its own explanation, including the site default and the dot-path `fields` usage. The description adds no parameter-level meaning beyond that, so the baseline of 3 applies.

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 definition opens with a specific verb and resource ("List a switch's ports") and then enumerates the exposed data points: link state, speed, PoE, assigned profile, LLDP neighbours, link aggregation, per-port overrides. That is far more precise than the title, and the required `mac` parameter makes clear the scope is one specific switch rather than all devices. It does not explicitly contrast with the nearest sibling (unifi_list_devices), which keeps it off a 5.

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?

No sentence states when to reach for this tool versus unifi_list_devices or unifi_list_port_profiles, and no prerequisites or exclusions are given. Usage is nevertheless strongly implied by the description (inspecting the physical port layout of a named switch) and by the `up` filter, so the scenario is inferable rather than absent.

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