Skip to main content
Glama

aggregate_flows

Aggregate packet flows from PCAP files by arbitrary tshark fields such as IPs, protocols, or ports. Get ranked tables of flow groups with packet counts and byte totals, with optional display filters.

Instructions

Aggregate packet flows grouped by arbitrary tshark field combinations.

Extracts the specified fields plus frame.len from each packet, then groups and sums by those fields. Default grouping is (src IP, dst IP, protocol number).

Args: file_path: Path to the PCAP file group_by: Comma-separated tshark field names to group by (default: "ip.src,ip.dst,ip.proto"). Examples: "ip.src,tcp.dstport" for per-service flows, "ip.src,ip.dst,ip.proto,tcp.dstport" for 5-tuple display_filter: Optional display filter (e.g. "tcp.dstport == 5432") top_n: Number of top flows to return, ranked by bytes (default: 20)

Returns: Table of flow groups with packet count and byte total, ranked by volume

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNo
group_byNoip.src,ip.dst,ip.proto
file_pathYes
display_filterNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the burden of behavioral disclosure. It explains that fields plus frame.len are extracted, grouping and summing are performed, and results are ranked by bytes. This is good transparency, though it omits potential performance implications or error handling, which prevents 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?

The description is well-structured with a one-sentence summary, followed by concise explanatory paragraphs and a Returns section. Every sentence carries useful information, and it is front-loaded with the core purpose.

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?

For a tool with 4 parameters and no annotation support, this description is complete: it covers all parameters, default behavior, grouping logic, and return value summary. The output schema exists, but the description still adds clarity on ranking and table contents.

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?

The input schema has 0% description coverage, but the description fully compensates with an Args section that explains every parameter: file_path, group_by (with default and examples), display_filter, and top_n (with default and ranking meaning). This is exemplary parameter documentation.

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: 'Aggregate packet flows grouped by arbitrary tshark field combinations.' This clearly distinguishes it from sibling tools like get_conversations or get_flow_matrix by emphasizing arbitrary field grouping and aggregation, not just predefined flow views.

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?

The description provides clear usage context through defaults and examples, such as grouping by ip.src,ip.dst,ip.proto and the optional display_filter. However, it does not explicitly state when to use this tool over alternatives or mention exclusions, so it falls short of full guidance.

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

Install Server

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/ouonet/tshark-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server