Skip to main content
Glama
owine

UniFi Network MCP Server

by owine

List switch stacks

unifi_list_switch_stacks
Read-only

List switch stacks at a UniFi site to identify stacked switches, their primary device, member units, and LAGs. Use it before fetching individual device configs or stats.

Instructions

List Switch Stacks (multiple physical switches managed as one logical unit) at a site. Returns: id, deviceId (the stack's primary device), name, units[] (the stacked switches — named members on consoles older than 10.6.106), lags[] (LAGs spanning the stack), metadata.origin. Per-unit schema is not rendered in the 11.0.83 docs — call unifi_get_switch_stack to inspect. Use for: identifying stacked switches; individual member configs/stats still come from unifi_get_device.

Input Schema

NameRequiredDescriptionDefault
limitNoNumber of records to return (API default: 25)
filterNoFilter expression, e.g. name.like('Core*') or metadata.origin.eq('USER_DEFINED'). Device filters (members.deviceId, units.deviceId) are rejected on 11.0.83
offsetNoNumber of records to skip
siteIdYesSite ID

Output Schema

NameRequiredDescriptionDefault
dataYes
countNo
limitNo
offsetNo
totalCountNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv2.15.0
    • changedInput schema / properties / filter / description
      Previous value: -"Filter expression"New value: +"Filter expression, e.g. name.like('Core*') or metadata.origin.eq('USER_DEFINED'). Device filters (members.deviceId, units.deviceId) are rejected on 11.0.83"
    • changedInput schema / properties / limit / description
      Previous value: -"Number of records to return (default: 25, max: 200)"New value: +"Number of records to return (API default: 25)"
    • changedInput schema / properties / offset / description
      Previous value: -"Number of records to skip (default: 0)"New value: +"Number of records to skip"
    • addedInput schema / properties / siteId / pattern
      Added value: +"^[A-Za-z0-9_-]{1,64}$"
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +{}
    • addedOutput schema / properties / data / items / properties / metadata / properties / configurable
      Added value: +{
      +  "type": "boolean"
      +}
  2. Changed3 schema fields changedv2.13.0
    • changedInput schema / properties / limit / minimum
      Previous value: -1New value: +0
    • addedOutput schema / properties / data / items / properties / deviceId
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / data / items / properties / units
      Added value: +{
      +  "items": {},
      +  "type": "array"
      +}
  3. First observedv2.8.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only cover the safety profile (readOnly, non-destructive). The description adds substantive behavior the annotations cannot: version-specific return naming (units[] vs `members` on consoles older than 10.6.106), a documentation gap in 11.0.83 for the per-unit schema, and a filter restriction (device filters rejected on 11.0.83).

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?

Front-loaded with purpose, then returns, then usage — good ordering with no filler sentences. It is dense with parenthetical asides (concept definition, version caveat, doc gap), which slightly slows scanning but each aside carries real information.

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?

An output schema exists, yet the description still adds the version-drift caveat that the output schema cannot express. Together with the sibling routing and filter restriction, nothing an agent needs to invoke this correctly is missing.

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 limit/offset/filter/siteId meaning is already fully documented in the schema. The description adds essentially nothing about parameter syntax or semantics beyond what the schema states (the device-filter rejection note is duplicated in the schema's filter description). Baseline 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+resource ('List Switch Stacks') and immediately defines the domain concept (multiple physical switches managed as one logical unit) scoped to a site. It also distinguishes itself from siblings unifi_get_switch_stack and unifi_get_device, so an agent can select it without opening any schema.

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?

Explicit 'Use for: identifying stacked switches' plus an exclusion — member configs/stats come from unifi_get_device, and per-unit schema requires unifi_get_switch_stack. This names the alternatives and the conditions that select them.

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