Skip to main content
Glama
GautamVhavle

Universal JSON Agent MCP

by GautamVhavle

group_by

Organize an array of objects into groups by a specified field, returning counts and grouped data for quick JSON analysis.

Instructions

Group an array of objects by a field value.

Args: alias: The alias of the loaded document. path: Dot-notation path to the array of objects. field: The field to group by (e.g. "category", "status").

Returns: A summary of groups with counts, plus the grouped data.

Input Schema

NameRequiredDescriptionDefault
pathYes
aliasYes
fieldYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/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. It does disclose the return shape ('a summary of groups with counts, plus the grouped data'), which is genuinely useful context beyond the schema. It does not say whether the operation is non-mutating with respect to the loaded document, how missing or null field values are handled, or what happens on an invalid path.

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?

The leading sentence is front-loaded with the core action, followed by structured Args/Returns sections with no filler. The docstring-style formatting is slightly verbose but every line carries information.

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?

An output schema exists, so the return description is bonus rather than required, and all three required parameters are explained. The remaining gap is behavioral edge cases (missing field, empty array, non-object elements) for an analysis tool operating on already-loaded data.

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 description coverage is 0%, so the description must compensate, and it does: it explains that alias refers to a loaded document, that path uses dot-notation to reach the array, and gives concrete field examples ('category', 'status'). The alias explanation is thin relative to how load_json/list_loaded establish aliases, keeping it below a 5.

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?

The description states a specific verb and resource ('Group an array of objects by a field value'), which is unambiguous. However, it does not distinguish itself from closely related siblings like value_counts, unique_values, or count, which an agent could easily confuse with it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

There is no guidance on when to use this instead of value_counts or unique_values, nor any prerequisites (e.g., that the document must already be loaded via load_json and referenced by alias). The agent must infer all routing decisions 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.