Skip to main content
Glama
owine

UniFi Network MCP Server

by owine

List client sessions

unifi_list_client_sessions
Read-only

Read past client connections, including disconnected clients, from a UniFi controller for a specified site and UTC time window (max 31 days). Returns session details: MAC, hostname, and data usage.

Instructions

Read retained past client connections, including disconnected clients, from the controller stat/session query endpoint. POST here only reads statistics. Rows carry only _id, mac, hostname, is_wired, assoc_time (epoch seconds), duration (seconds), rx_bytes/tx_bytes (controller perspective) and roaming_sessions when available. Use an explicit UTC epoch-second window (max 31 days). If mayBeTruncated is true, split the time window (overlap boundaries and deduplicate IDs) or filter by MAC. The controller ignores offset pagination. Records reflect controller retention and may omit ongoing sessions. Wi-Fi association/bytes do not establish end-to-end Internet success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYesEnd Unix epoch seconds; after start and at most 31 days later
macNoOptional client MAC address
limitNoMaximum records; a full result requires a narrower window or MAC filter
startYesStart Unix epoch seconds, not milliseconds
siteReferenceYesSite internalReference from unifi_list_sites (often default), not the Integration API UUID

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYes
dataYes
countYes
limitYes
startYes
coverageYes
mayBeTruncatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.15.0
    • changedInput schema / properties / limit / default
      Previous value: -1000New value: +100
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +{}
  2. Addedv2.14.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and destructiveHint=false, and the description adds real value on top: it explains that a POST here only reads statistics (pre-empting the false impression that POST implies mutation), that results are bounded by controller retention and may omit ongoing sessions, that mayBeTruncated signals truncation, and that Wi-Fi association/bytes do not prove end-to-end Internet success. These are substantive behavioral caveats not present in the structured fields.

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 constraints, then failure-mode handling, then caveats; no filler sentences. It is dense and slightly long, with some row-field enumeration that overlaps the output schema, but each clause carries actionable 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?

For a filtered read tool with 100% schema coverage, an output schema, and explicit read-only annotations, the definition covers everything an agent needs: window construction, retention limits, truncation handling, pagination behavior, and interpretation caveats for the byte/association fields.

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 the schema already documents start, end, mac, limit, and siteReference, and the description adds little beyond restating the UTC epoch-second window and 31-day cap. Marginal added meaning (MAC filtering as a truncation workaround) keeps it at the baseline rather than below it.

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?

States a specific verb and resource ('Read retained past client connections... from the controller stat/session query endpoint') and clarifies that disconnected clients are included, which is more than the name conveys. However it never distinguishes itself from the very similar sibling unifi_list_client_history, so an agent must guess which session/history tool to pick.

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?

Gives concrete operational guidance: use an explicit UTC epoch-second window with a 31-day maximum, and if mayBeTruncated is true, split the window (overlapping boundaries and deduplicating IDs) or filter by MAC. It also warns that offset pagination is ignored. It stops short of naming when to prefer this over unifi_list_client_history or unifi_list_clients.

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