Skip to main content
Glama
GautamVhavle

Universal JSON Agent MCP

by GautamVhavle

count

Get the number of items in an array or keys in an object at a given path. Quickly retrieve item or key totals from loaded JSON data.

Instructions

Count items in an array or keys in an object at a given path.

Args: alias: The alias of the loaded document. path: Dot/bracket notation path. Empty string means root.

Returns: The item/key count at the given path.

Input Schema

NameRequiredDescriptionDefault
pathNo
aliasYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It never states that the operation is read-only, that the alias must first be registered via load_json, or what happens when the path is missing or points to a scalar. Only a bare return statement is given.

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 is front-loaded in one sentence, followed by compact Args and Returns blocks. The Returns block is somewhat redundant given an output schema exists, but nothing is padded or meandering.

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?

For a two-parameter read tool this is close to sufficient, and the output schema covers return values. Still missing is error/edge-case behavior for nonexistent paths or scalar targets, and the dependency on a prior load_json call.

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%, but the Args block compensates well: path is documented as dot/bracket notation with an empty string meaning root, and alias is tied to a loaded document. This adds real meaning beyond the bare schema titles, though the alias/load_json prerequisite is only implicit.

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 first sentence gives a specific verb and resource: count items in an array or keys in an object at a given path. It is unambiguous what is being counted. It does not, however, distinguish itself from nearby siblings such as value_counts, get_keys, or describe, 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 explicit when-to-use or when-not-to-use guidance, and no sibling is named. An agent must infer from general JSON intuition that this counts elements rather than value frequencies (value_counts) or listing keys (get_keys).

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