Skip to main content
Glama

get_device_stp_state

Retrieve the STP/RSTP state of a UniFi device and its per-port STP role, state, and path cost to inspect spanning tree topology and troubleshoot connectivity problems.

Instructions

Get per-device STP/RSTP state and per-port STP role/state/path-cost.

Read-only and Fabric-only: reads the same Classic REST /v1/connector/consoles/{host_id}/proxy/network/api/s/{site_slug}/stat/device payload as list_device_stats and projects the selected device's STP fields. Returns the device-level stp_version, stp_priority, root_switch/root (and any other stp_* field present) plus per-port STP role/state/path-cost where upstream provides them, all verbatim. This tool is read-only: STP-priority write support is documented in the PR description only and no write is performed here.

host: console name, ID, or composite ID (MAC:numericId format). site: site name or ID. device_id: device selector — its /stat/device _id, id, or mac (case- and separator-insensitive).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes
siteYes
device_idYes
Install Server

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well. It explicitly states the tool is read-only, performs no write, is Fabric-only, returns fields verbatim, and depends on upstream availability for per-port data. It even clarifies that documented write support elsewhere is not performed here.

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 with the core purpose. Every sentence adds value: scope, read-only guarantee, relationship to sibling tool, returned fields, and parameter semantics. It is detailed without being padded.

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?

Despite having no output schema or annotations, the description provides enough information to invoke the tool correctly: the underlying endpoint, the fields returned, upstream data caveats, and all parameter formats. Nothing essential is missing for a read-only retrieval tool with three simple parameters.

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%, but the description fully compensates by explaining all three parameters: accepted host formats, site name/ID, and device selector flexibility including case- and separator-insensitivity. This adds substantial meaning beyond bare property names.

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: 'Get per-device STP/RSTP state and per-port STP role/state/path-cost.' It clearly distinguishes this tool from list_device_stats by explaining that it projects only the selected device's STP fields from the same payload.

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 gives clear context: it is read-only and Fabric-only, and it names list_device_stats as the related tool that reads the same underlying payload. It does not explicitly state 'use this instead of X when you need STP fields,' but the relationship is clear enough for an agent to infer the right choice.

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