Skip to main content
Glama

Build nested field hierarchy

arkime_spigraphhierarchy
Read-only

Build nested top-N hierarchies across Arkime fields for drill-down analysis, returning parent-to-child value trees that mirror Arkime's SPI-graph view.

Instructions

Build a nested top-N hierarchy across Arkime fields (a treemap / drill-down).

    Returns a nested hierarchy (level 1 -> its top level-2 values -> ...),
    matching Arkime's SPI-graph hierarchy view. Unlike malcolm_aggregate's
    flat multi-field buckets and arkime_multiunique's flat tuple list, the
    result is nested. For a single field plus a time graph use
    arkime_spigraph; for a source/destination graph use arkime_connections.
    Returns the raw Arkime spigraph-hierarchy response (nested value tree).

    Level 1 is the outermost, and every deeper level's top values are
    counted inside their own parent rather than globally, so a value that
    is common overall can be missing from a branch where it is rare. Each
    level keeps Arkime's top 20 and this tool does not expose that number:
    measured on Malcolm v26.07.1, a two-level tree returned 20 first-level values
    out of the 112 the window held, each parent carrying a different number
    of children. A "Note:" line above the JSON counts the nodes holding
    exactly 20 children, whose lists may be cut. An empty tree with no time
    range usually means the data predates Arkime's default recent window:
    pass time_from.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsYesComma-separated Arkime fields defining the hierarchy levels in order, e.g. "source.ip,destination.ip,destination.port".
time_toNoEnd time as EPOCH SECONDS (NOT a dateparser string). Empty = now.
time_fromNoStart time as EPOCH SECONDS (NOT a dateparser string). Empty = Arkime's recent-only default.
expressionNoOptional Arkime expression syntax to scope the data. Empty = all sessions.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.3

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the read-only, open-world, non-destructive profile, but the description adds substantial behavioral detail beyond them: per-level top-20 truncation that is not exposed, the measured 20-of-112 example, the 'Note:' line counting nodes with exactly 20 children, and the empty-tree-means-time-window gotcha. This is exactly the kind of operational context annotations cannot convey.

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?

Front-loads the core purpose in the first sentence, then routing, then return shape, then caveats. Every sentence carries information, though the description is on the long side and the truncation/Note discussion could be tightened slightly.

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?

An output schema exists so return-value documentation is not strictly required, yet the description still clarifies it returns the raw nested spigraph-hierarchy tree. Combined with the truncation caveats and time-window guidance, an agent has everything needed to call and interpret this tool correctly.

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 schema already documents all four parameters and a baseline of 3 applies. The description adds meaning beyond the schema by explaining that fields define hierarchy levels in order, that an empty tree usually indicates the default recent window and that time_from should be passed, which is genuinely useful parameter-context guidance.

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 (build a nested top-N hierarchy / treemap across Arkime fields) and explicitly distinguishes the result from malcolm_aggregate and arkime_multiunique by noting it is nested rather than flat. An agent can identify what this tool produces without opening any 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?

Names concrete alternatives and the conditions that select them: malcolm_aggregate and arkime_multiunique for flat output, arkime_spigraph for a single field plus a time graph, arkime_connections for source/destination graphs. This is explicit when-to-use / when-to-use-something-else guidance.

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