Skip to main content
Glama

Build nested field hierarchy

arkime_spigraphhierarchy
Read-only

Build a nested Arkime field hierarchy for treemap or drill-down views, returning top child values per parent as a value tree.

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,
    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

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

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 it as a safe read (readOnlyHint/destructiveHint=false), so the description carries the real behavioral load: per-level top-20 truncation that is not exposed as a parameter, the 'Note:' line flagging nodes with exactly 20 children, and the empty-tree-means-stale-window caveat. That is substantive context an agent cannot get from the annotations.

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-loaded with the purpose, then siblings, then caveats — a sensible ordering. It is somewhat long and restates the nesting idea twice ('level 1 -> its top level-2 values' and later the per-parent counting explanation), but nearly every sentence carries distinct information.

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 values need not be spelled out, yet the description still sets expectations for the raw nested Arkime response. Combined with truncation behavior, the empty-result diagnosis, and the required-field context, an agent has everything needed to call and interpret this tool.

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, but the description genuinely adds meaning: it explains that 'fields' order defines nesting depth (level 1 outermost), that deeper counts are scoped inside their parent rather than global, and that an empty tree implies time_from should be set. It stops short of clarifying time_to/time_from format, which the schema already covers.

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 across Arkime fields') and immediately glosses it as a treemap/drill-down. It explicitly distinguishes itself from malcolm_aggregate, arkime_multiunique, arkime_spigraph and arkime_connections, so an agent can pick it 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 the alternatives and the conditions that select them: single field plus time graph -> arkime_spigraph, source/destination graph -> arkime_connections, flat buckets -> malcolm_aggregate. It also gives a recovery instruction for the empty-result case ('pass time_from').

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