Skip to main content
Glama

List traffic flows

unifi_list_traffic_flows
Read-only

List recent UniFi gateway traffic flows with source, destination, app, action, risk, bytes and matched policies. Filter by client, IP, domain, action, risk or search; defaults to the last 15 minutes.

Instructions

List recent traffic flows seen by the gateway (Insights > Flows): source and destination client, IP, domain and network, app/service, allowed or blocked, risk, bytes and the policies that matched. This is an expensive query on the gateway, so it looks back 15 minutes (hours: 0.25) and returns 50 flows per page by default; narrow it with client_mac, action, risk or search (applied by the controller to app, domain, client name and more) before widening the window. Recent Network 9.x/10.x with a UniFi gateway.

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_list_traffic_flows"
  }
}

Input Schema

NameRequiredDescriptionDefault
rawNoReturn the full controller objects (large)
pageNoPage number, from 0
riskNoOnly flows with this risk level
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 0.25, i.e. 15 minutes)
actionNoOnly allowed or only blocked flows
fieldsNoOnly return these fields per item (dot paths, e.g. uplink.name)
searchNoCase-insensitive substring match on names, MACs, IPs and similar
client_ipNoOnly flows from this source IP
page_sizeNoFlows per page (default 50)
client_macNoOnly flows from this client MAC address
destination_domainNoOnly flows to this domain

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.9.1
    • addedInput schema / properties / fields / description
      Added value: +"Only return these fields per item (dot paths, e.g. uplink.name)"
    • addedInput schema / properties / hours
      Added value: +{
      +  "description": "Look back this many hours (default 0.25, i.e. 15 minutes)",
      +  "exclusiveMinimum": 0,
      +  "maximum": 168,
      +  "type": "number"
      +}
    • removedInput schema / properties / limit
      Removed value: -{
      -  "description": "Flows per page (default 50)",
      -  "exclusiveMinimum": 0,
      -  "maximum": 500,
      -  "type": "integer"
      -}
    • removedInput schema / properties / minutes
      Removed value: -{
      -  "description": "Look back this many minutes (default 15)",
      -  "exclusiveMinimum": 0,
      -  "maximum": 10080,
      -  "type": "integer"
      -}
    • addedInput schema / properties / page_size
      Added value: +{
      +  "description": "Flows per page (default 50)",
      +  "exclusiveMinimum": 0,
      +  "maximum": 500,
      +  "type": "integer"
      +}
    • addedInput schema / properties / search / description
      Added value: +"Case-insensitive substring match on names, MACs, IPs and similar"
  2. First observedv0.8.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=false, so safety is covered; the description goes further by disclosing cost ('expensive query on the gateway'), the default lookback window and the default page size, plus a firmware prerequisite. These are exactly the operational facts annotations cannot express. It does not discuss whether paging past the cost window is possible or what happens at the 168-hour cap, leaving some depth unused.

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 sentences, front-loaded with purpose followed by cost and defaults, with the field enumeration earning its space because no output schema exists. The parenthetical field list is dense but functional rather than padding.

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?

With 12 optional parameters, no output schema and a cost-sensitive backend, the description covers purpose, returned fields, defaults, narrowing strategy and prerequisites, which is close to sufficient. It could say more about pagination limits across pages or total result caps, but nothing essential to a correct first call is missing.

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 baseline would be 3, but the description adds real meaning: it clarifies that 'search' is applied by the controller across app, domain, client name and more, which is broader than the schema's 'names, MACs, IPs and similar'. It also spells out hours=0.25 as 15 minutes and groups the narrowing filters. It does not explain `raw` or `fields` interplay, so it is not exhaustive.

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 a specific verb and resource ('List recent traffic flows seen by the gateway') and even anchors it to the UI location (Insights > Flows). It then enumerates exactly what each flow record contains (client, IP, domain, app/service, action, risk, bytes, matched policies), so an agent knows both what the tool does and what it returns 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 Guidelines4/5

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

It gives actionable usage context: the query is expensive, it defaults to a 15-minute window, and the agent should narrow with client_mac, action, risk or search before widening the window. It also states a prerequisite ('Recent Network 9.x/10.x with a UniFi gateway'). It stops short of naming an alternative tool or an explicit when-not-to-use case, so it is clear but not fully routing.

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