Skip to main content
Glama

Get DPI statistics

unifi_get_dpi_stats
Read-only

Retrieve deep packet inspection traffic stats grouped by application or category for an entire site or specified client MACs, with the highest-volume traffic listed first.

Instructions

Get deep packet inspection (traffic identification) statistics, by application or by category, biggest first: site-wide, or per client when macs are given. Uses the v2 traffic endpoint (Network 9+), with names from the official API when an API key is configured, and falls back to the classic stat/sitedpi on older versions. Requires traffic identification to be enabled.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "unifi_get_dpi_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
byNoGroup by application or category (default category)
macsNoClient MACs to report on instead of the whole site
siteNoSite name/ID as used in the API (e.g. 'default'). Defaults to the configured site. See unifi_list_sites.
hoursNoLook back this many hours (default 24; not supported by the classic endpoint)
limitNoTop rows to return per list (default 25)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.9.1
    • addedInput schema / properties / hours
      Added value: +{
      +  "description": "Look back this many hours (default 24; not supported by the classic endpoint)",
      +  "exclusiveMinimum": 0,
      +  "maximum": 2160,
      +  "type": "number"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Top rows to return per list (default 25)",
      +  "exclusiveMinimum": 0,
      +  "maximum": 1000,
      +  "type": "integer"
      +}
  2. First observedv0.8.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already establish readOnly and non-open-world, and the description adds substantive behavior beyond them: the underlying endpoint varies by controller version (v2 traffic endpoint on Network 9+, classic stat/sitedpi fallback), names are enriched only when an API key is configured, and results are not available unless traffic identification is enabled. This tells the agent why output may differ across deployments, which is exactly the kind of context annotations cannot carry.

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?

Two dense sentences, front-loaded with the resource and scope before version/fallback details. Nearly every clause carries information, though the version-fallback sentence is long and slightly compresses several facts into one run-on construction.

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 no output schema, the description still covers scope, ordering, grouping, per-client targeting, the prerequisite toggle, and version-dependent data sourcing — everything an agent needs to call it correctly and interpret why results might be empty or differently named. Remaining details (defaults, ranges) are fully covered by the schema.

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 description coverage is 100%, so the baseline is 3, but the description adds ordering semantics ('biggest first') that clarify what limit actually truncates, and it ties macs to the 'per client' scope shift. It does not explain the hours/version interaction beyond what the schema already notes.

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 and resource ('Get deep packet inspection (traffic identification) statistics') plus the grouping dimension ('by application or by category'), ordering ('biggest first'), and scope ('site-wide, or per client when macs are given'). An agent can immediately understand what this returns and how it can be sliced.

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

Usage Guidelines3/5

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

Provides a real prerequisite ('Requires traffic identification to be enabled') and explains which scope applies depending on whether macs are supplied, which is implicit when-to-use guidance. However, it never names or contrasts with the closely related sibling unifi_get_traffic_report, so an agent choosing between the two gets no routing help.

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