Skip to main content
Glama

get_historical_stats

Retrieve time-bucketed UniFi network stats for APs, users, or sites, choosing 5-minute, hourly, or daily intervals and metrics like client count and traffic.

Instructions

Get bucketed historical statistics from the Classic REST /stat/report endpoint.

host: console name, ID, or composite ID (MAC:numericId format). site: site name or ID. interval: one of "5minutes", "hourly", "daily". scope: one of "ap", "user", "site". The "ap" scope carries num_sta per AP per bucket. start/end: epoch SECONDS (UTC). Unlike /stat/session, this endpoint requires MILLISECONDS — the tool converts seconds to milliseconds internally, so callers always pass seconds for a consistent interface. attrs: metrics to aggregate; defaults to num_sta, rx_bytes, tx_bytes.

Retention differs by interval: 5minutes ~1 day, hourly ~7 days, daily ~91 days. Output "time" is epoch milliseconds. Note: rx_bytes/tx_bytes come back as JSON floats in scientific notation (e.g. 5.27e9) — treat them as floats, not ints.

The response is passed through verbatim.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYes
hostYes
siteYes
attrsNo
scopeYes
startYes
intervalYes
Install Server

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and excels: it discloses internal unit conversion (seconds to milliseconds), retention policies per interval, output time epoch unit, scientific notation for float metrics, and verbatim response passthrough. These behavioral details are critical for correct interpretation and are not inferable from the schema.

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?

The description is longer than average but each sentence serves a purpose. It is organized into parameter definitions and follow-up notes. While not ultra-concise, the density of essential information justifies the length; a slight reordering could improve flow but the current structure is logical.

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 7 parameters, no output schema, and no annotations, the description covers all operational essentials: parameter meaning, enums, defaults, unit conversions, retention, and output quirks. An agent has everything needed to invoke the tool correctly and interpret results.

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 fully document parameters. It explains host/site formats, interval enums, scope options with special behavior for 'ap', start/end unit and conversion, and attrs default with example metrics. This completely compensates for the schema gap.

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?

The description clearly states the verb ('Get') and resource ('bucketed historical statistics') and names the specific REST endpoint. It distinguishes itself from /stat/session but does not explicitly compare to sibling tools, so it's clear but not fully differentiated from similar statistics tools.

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

Usage Guidelines2/5

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

The description provides detailed parameter semantics and a note about the difference from /stat/session, but it does not state when to use this tool versus alternatives. There is no explicit when/when-not guidance or mention of sibling tools, leaving the selection decision to the agent.

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