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
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| site | Yes | ||
| device_id | Yes |