Skip to main content
Glama

Get traffic/usage report

unifi_get_traffic_report
Read-only

Retrieve historical UniFi traffic and client-count time series in 5-minute to monthly buckets for sites, gateways, access points, or individual clients.

Instructions

Get historical time-series statistics in buckets of 5 minutes to a month. scope=site for whole-site traffic and client counts, gw for gateway CPU/memory/WAN traffic, ap for per-AP traffic, user for per-client traffic (pass macs). For traffic by application use unifi_get_dpi_stats.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "scope": "<scope>"
    },
    "name": "unifi_get_traffic_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
macsNoLimit to these device/client MACs (ap and user scopes)
siteNoSite name/ID as used in the API (e.g. 'default'). Defaults to the configured site. See unifi_list_sites.
attrsNoOverride the attributes to fetch, e.g. ['rx_bytes','tx_bytes','time']
hoursNoLook back this many hours (default: 12 for 5minutes, 168 for hourly, 720 for daily, 8760 for monthly)
scopeYesWhat to report on
intervalNoBucket size (default hourly)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.1

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover the read-only, non-open-world safety profile; the description adds the meaningful extra that results are historical and bucketed across a wide granularity range, plus the operational note to pass MACs for user scope. It does not state retention limits, rate limits, or response shape, which keeps it from a 5.

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?

Three short sentences, front-loaded with the capability, followed by scope enumeration and a single sibling redirect. No filler and no restatement of the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter read-only reporting tool with full schema coverage and no output schema, the description covers purpose, scope selection, and the key parameter constraint. Only the shape of the returned series is unstated, which is a minor gap given rich per-parameter schema text.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining the practical meaning of scope values and flagging that macs must be passed for user scope, which the schema only weakly implies. Interval/hours/attrs semantics are left entirely to the schema.

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?

States a specific verb+resource ("Get historical time-series statistics") with granularity bounds (5 minutes to a month), then enumerates what each scope reports on. It also explicitly distinguishes itself from unifi_get_dpi_stats, so an agent can pick correctly without opening a schema.

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?

Gives explicit selection criteria for every scope value (site = whole-site traffic and client counts, gw = gateway CPU/memory/WAN, ap = per-AP, user = per-client) and redirects application-level traffic to unifi_get_dpi_stats. That is exactly the when-to-use-this-vs-alternative guidance an agent needs.

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