Skip to main content
Glama
GautamVhavle

Universal JSON Agent MCP

by GautamVhavle

value_counts

Count occurrences of each distinct value matched by a JSONPath expression, returning a frequency table sorted by count. Use it to find the most common values in JSON data.

Instructions

Count occurrences of each distinct value matched by a JSONPath expression.

Like a frequency table: shows each unique value and how many times it appears. Results are sorted by count (most common first).

Args: alias: The alias of the loaded document. expression: A JSONPath expression (e.g. "$.orders[*].status").

Returns: A frequency table with values and their counts.

Input Schema

NameRequiredDescriptionDefault
aliasYes
expressionYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose output ordering ("sorted by count, most common first") and shape (frequency table of values and counts). It omits what happens on an unknown alias or malformed JSONPath, and whether missing paths are skipped or counted as null.

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?

Purpose, behavior, and the Args/Returns breakdown are front-loaded and each line carries information. The Returns line is somewhat redundant given an output schema exists, and the two-line analogy could be one.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so not explaining return values in depth is acceptable, and both parameters are covered. However, for a tool whose main failure modes are invalid expressions and bad aliases, no error or precondition information is given, leaving a clear gap.

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 0% and the schema only declares bare strings, so the description must compensate. It defines `alias` as the loaded document identifier (linking it to load_json/list_loaded) and illustrates `expression` with a concrete JSONPath like "$.orders[*].status", which is meaningfully more than the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb and resource ("count occurrences of each distinct value matched by a JSONPath expression") and reinforces it with an analogy ("Like a frequency table"). This separates it from the flat `count` sibling, though it never explicitly contrasts with `unique_values`, `group_by`, or `describe`, which overlap conceptually.

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?

Usage is only implied by the example expression and the frequency-table analogy; there is no statement of when to prefer this over `unique_values` (values alone) or `count` (single total). The agent must infer the selection rule from sibling names alone.

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