Mist Client & Usage Analyser
Look up clients by name/MAC, analyse application usage, bandwidth, roaming behaviour, and rank clients or sites by traffic — all from live Mist data.
Workflow
Step 0 — Resolve identities
get_mist_self→org_id.- If user names a site, resolve it by name:
search_mist_data(scope='org', search_type='sites', org_id=..., filters={name:'<site_name>'})→site_id. Only fetch the full site list (get_mist_config(resource_type='sites', scope='org', org_id=..., limit=200)) when you need a complete site map (e.g., org-wide or ranking queries). - If the user provides a client name or MAC, resolve it:
find_mist_entity(org_id=..., query='<name_or_mac>'). Note theentity_type,mac,site_id.
Step 1 — Route by question type
| User intent | Go to |
|---|---|
| Application usage for a client | Step 2 |
| Bandwidth / bytes used by a client | Step 3 |
| Client association timeline (AP history) | Step 4 |
| Filter clients by manufacturer (OUI) | Step 5 |
| Check VLAN membership | Step 6 |
| Rank clients by TX/RX bytes | Step 7 |
| 6 GHz clients | Step 8 |
| Interband roaming detection | Step 9 |
| Clients connected to a specific switch | Step 10 |
| Top sites by usage | Step 11 |
| Application usage at a site | Step 12 |
Step 2 — Application usage per client
- Call
get_mist_insights(insight_type='insight_metrics', site_id=..., duration='1d', params={object_type:'client', metric:'top-app-by-bytes', mac:'<compact_mac>'}). - If the metric name is wrong, discover available metrics first:
get_mist_constants(constant_type='insight_metrics')and look for app-related metrics. - Present app name, bytes, and percentage of total.
Step 3 — Bandwidth / bytes used
- Get live client stats:
get_mist_stats(stats_type='site_wireless_clients', site_id=..., object_id='<compact_mac>'). - Extract
tx_bytesandrx_bytes. Format as human-readable (KB/MB/GB). - If client is not currently connected, search recent sessions:
search_mist_data(scope='org', search_type='client_sessions', org_id=..., filters={mac:'<compact_mac>'}, duration='1d')and sum data if available.
Step 4 — Association timeline
search_mist_data(scope='org', search_type='client_sessions', org_id=..., filters={mac:'<compact_mac>'}, duration='7d', limit=100). Paginate.- Build AP MAC → AP name map:
get_mist_stats(stats_type='site_devices', site_id=..., filters={type:'ap'}). - For each session, extract:
connect(epoch → human time),disconnect,duration,ap(→ AP name),band,ssid. - Present as a chronological timeline. Flag anomalies: sessions < 10s (likely failures), rapid AP changes (roaming issues).
Step 5 — Filter by manufacturer (OUI)
search_mist_data(scope='org', search_type='wireless_clients', org_id=..., duration='7d', limit=100). Addsite_idfilter if site specified. Paginate fully.- Filter results where
mfgcontains the manufacturer string (case-insensitive). Examples: "Intel Corporate", "Raspberry Pi Trading Ltd", "Apple, Inc." - For each matched client, show: hostname, MAC, manufacturer, last_ap, last_ssid, last_os, last_ip.
- If user wants application summary for policy building, follow up with Step 2 for each matched client.
Step 6 — VLAN membership check
- Resolve client:
find_mist_entity(org_id=..., query='<mac>'). - Search:
search_mist_data(scope='org', search_type='wireless_clients', org_id=..., filters={mac:'<compact_mac>'}, duration='1d'). - Check
last_vlanorvlanarray in results. Compare against the requested VLAN number. - Also check wired clients:
search_mist_data(scope='org', search_type='wired_clients', org_id=..., filters={mac:'<compact_mac>'}).
Step 7 — Rank clients by TX/RX throughput
- Use
get_mist_stats(stats_type='site_wireless_clients', site_id=...)to get all currently connected clients with live stats. Paginate fully. - If no site specified, identify the target site first via Step 11 or the user's context.
- Sort by
tx_bps + rx_bpsdescending (real-time throughput in bits/sec). Take top N. - Present: rank | hostname | MAC | TX rate | RX rate | total rate | AP | SSID. Format bps as Kbps/Mbps.
- Note: this shows only currently connected clients with real-time rates. For historical byte totals, use
search_mist_data(search_type='client_sessions')and sum session data if available.
Step 8 — 6 GHz clients
search_mist_data(scope='org', search_type='wireless_clients', org_id=..., filters={band:'6'}, duration='1d'). Addsite_idif scoped. Paginate.- Present: hostname, MAC, manufacturer, AP, SSID, protocol.
Step 9 — Interband roaming
- Get client sessions:
search_mist_data(scope='org', search_type='client_sessions', org_id=..., filters={mac:'<compact_mac>'}, duration='7d', limit=100). Paginate. - Sort by
connecttimestamp ascending. - Walk sessions: if consecutive sessions have different
bandvalues and the gap between disconnect→connect is < 5 minutes, that's an interband roam. - Present: timestamp | from band | to band | from AP | to AP.
Step 10 — Clients on a specific switch
- Resolve switch:
find_mist_entity(org_id=..., query='<switch_name>', entity_types=['device']). - Get switch MAC from results.
- Search wired clients:
search_mist_data(scope='org', search_type='wired_clients', org_id=..., filters={device_mac:'<switch_mac>'}, duration='1d'). Paginate. - Present: hostname, MAC, IP, port, VLAN.
Step 11 — Top sites by usage
get_mist_stats(stats_type='sites', org_id=..., duration='7d'). Paginate.- Sort by
num_clients(most connected clients) ortx_bytes + rx_bytesif available. Thenum_clientsfield is the most reliable ranking metric. - Present top N with: site name | client count | AP count | usage metric.
Step 12 — Application usage at site level
- Resolve the site (by name or by feature like "site with SSR" → search for sites with gateway type SSR).
get_mist_insights(insight_type='insight_metrics', site_id=..., duration='1d', params={object_type:'site', metric:'top-app-by-bytes'}).- Present: app name | bytes | percentage.
Data formatting
- Bytes: auto-scale to KB/MB/GB (1 GB = 1,073,741,824 bytes)
- Timestamps: convert epoch seconds to
YYYY-MM-DD HH:MMin local timezone context - Duration: convert seconds to
Xh Ym(e.g., 3661 → "1h 1m") - MAC: display with colons (aa:bb:cc:dd:ee:ff) for readability
- Band: "24" → "2.4 GHz", "5" → "5 GHz", "6" → "6 GHz"
Output
Use canvas (web-artifacts-builder) for rich results when there's substantial data — client dashboards, timeline charts, ranking tables. Use markdown tables for simple lookups.
Error handling
| Situation | Action |
|---|---|
| Client not found | "No client matching '' found. Check MAC/hostname and retry." |
| No sessions in range | Widen the duration or report "No sessions found in the last N days." |
| Site name not found | Fuzzy-match with search_mist_data(search_type='sites', filters={name:'...'}) |
| Metric not available | Call get_mist_constants(constant_type='insight_metrics') to discover available metrics |
| Switch not found | Search by hostname: search_mist_data(search_type='devices', filters={hostname:'...'}) |
Source: tmunzer-AIDE/mist-skills — distributed by TomeVault.