Skip to main content
Glama

list_client_sessions

Get historical client connection sessions from UniFi with up to 90 days of retention. Filter by host, site, time range, and session type to view past client activity.

Instructions

List historical client connection sessions from the Classic REST /stat/session endpoint.

This is the highest-value history tool: retention is ~90 days, so it covers far more than the currently-connected client list.

host: console name, ID, or composite ID (MAC:numericId format). site: site name or ID. start/end: epoch SECONDS (UTC). This endpoint uses seconds natively — passing milliseconds returns HTTP 200 with an EMPTY array and no error, so seconds are enforced (millisecond-magnitude values are rejected). session_type: session class filter. The values that actually narrow the result are "all" (default — the full unfiltered set), "user" (regular clients), and "guest" (guest-network clients). WARNING: an unrecognised value is NOT rejected and does NOT return an empty array — the endpoint silently ignores it and returns the full "all" set, so a typo yields everything rather than a visible error or "no data". (UniFi documents "voucher" as a fourth class; on tested firmware it returned the full set, so prefer "user"/"guest" for real narrowing.)

Each session includes mac, is_wired, assoc_time (session start, epoch seconds), duration (seconds), ap_mac, rx_bytes, tx_bytes, satisfaction, hostname, ip, _id, and roaming_sessions[]. Two things that surprise callers:

  • There is NO explicit disconnect timestamp — session end is assoc_time + duration.

  • Radio band lives ONLY inside roaming_sessions[] (radio_band: na/ng/6e), never at the top level. Wired sessions have ap_mac=null and carry sw_mac/sw_port instead.

The response is passed through verbatim, including identifiers (MAC/IP/hostname).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYes
hostYes
siteYes
startYes
session_typeNoall
Install Server

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries full behavioral burden, and it delivers: it discloses retention, millisecond input behavior leading to empty arrays, silent ignoring of unrecognized session_type values, absence of disconnect timestamps, radio band location, wired session specifics, and verbatim identifier passthrough. This is exceptional transparency.

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?

Although long, the description is densely packed with actionable warnings and parameter semantics. Each sentence, paragraph, and parenthetical adds information the agent needs to call the tool correctly; there is no filler.

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?

Given no output schema and no annotations, the description fully compensates by documenting return fields, surprising behaviors, edge cases, and parameter constraints. An agent has everything needed to invoke this tool correctly and interpret its response.

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%, so the description must explain every parameter, and it does: host formats, site formats, start/end epoch units with enforcement details, and session_type values with warnings about invalid values. Nothing is left to schema guesswork.

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 states a specific verb and resource ('List historical client connection sessions') and names the exact endpoint ('Classic REST /stat/session endpoint'). It further distinguishes this tool from the currently-connected client list, so an agent can immediately understand its scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly frames this as 'the highest-value history tool' and contrasts its ~90-day retention with the currently-connected client list. This gives clear when-to-use guidance against the main alternative class of client-listing tools, without ambiguity.

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