Skip to main content
Glama
owine

UniFi Network MCP Server

by owine

unifi_list_client_sessions

Read-only

Retrieve retained past client sessions from UniFi Network, including disconnected clients, within a UTC time window. Returns session IDs, MACs, association time, duration, and traffic bytes.

Instructions

Read retained past client connections, including disconnected clients, from the controller stat/session query endpoint. POST here only reads statistics. Returns controller session IDs, MACs, 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. Do not interpret controller is_guest as proof of a person's identity or ownership.

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. Addedv2.14.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint/destructiveHint annotations, the description discloses that the endpoint is a POST that 'only reads statistics', explains truncation semantics, retention-dependent row availability, and warns against over-interpreting Wi-Fi association bytes and is_guest. This is substantial behavioral transparency that protects the agent from common misuse.

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 compact yet dense; every sentence delivers a distinct operational or interpretive fact. The primary purpose is front-loaded, and there is no filler or repetition of schema details, making the length justified.

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?

With an output schema available and full parameter documentation, the description still covers remaining decision-critical areas: pagination behavior, truncation handling, retention caveats, ongoing-session omission, and data interpretation guardrails. Nothing an agent needs to invoke or filter this tool correctly is missing.

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?

Even with 100% schema coverage, the description adds meaning: it reinforces that start/end form a UTC epoch-second window capped at 31 days, frames 'mac' as a truncation workaround, and links 'limit' to the need for a narrower window or MAC filter for full results. This goes well beyond the schema's property descriptions.

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 'Read retained past client connections, including disconnected clients, from the controller stat/session query endpoint', giving a specific verb, resource, and scope. It clearly signals historical/session data rather than live client state, and the 'may omit ongoing sessions' caveat further distinguishes it from listing or current-client tools.

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 provides clear operational context: 'Use an explicit UTC epoch-second window (max 31 days)', 'The controller ignores offset pagination', and a concrete remediation when mayBeTruncated is true ('split the time window... or filter by MAC'). It does not name an alternative sibling tool or give an explicit when-not-to-use, but the retention and ongoing-session caveats imply when a different tool is needed.

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