Skip to main content
Glama
GautamVhavle

Universal JSON Agent MCP

by GautamVhavle

sum_values

Sums numeric values matched by a JSONPath expression in a loaded document alias and returns the total and count.

Instructions

Sum numeric values matched by a JSONPath expression.

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

Returns: The sum and count of matched numeric values.

Input Schema

NameRequiredDescriptionDefault
aliasYes
expressionYes

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 that the result includes both a sum and a count, which is useful behavioral context. However, it does not say what happens when the expression matches non-numeric values, mixed types, or zero values (e.g., error vs. skip vs. sum to 0), nor does it state read-only semantics explicitly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with a single-sentence purpose, followed by a compact Args/Returns block. Every line adds information and nothing is redundant.

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?

The core contract (sum and count of matched numbers) and both parameters are covered, and an output schema exists so return formatting is not required. Still missing for a query/mutation-free tool with no annotations are edge-case behaviors: non-numeric matches, empty result sets, and the dependency on load_json.

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 and that 'expression' must resolve to numbers, reinforced by a concrete example ('$.orders[*].total'). Both parameters gain meaning beyond their bare titles.

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?

States a specific verb and resource: summing numeric values matched by a JSONPath expression. An agent can distinguish this from siblings like count or min_max by the stated operation, though the description never names those alternatives explicitly. Clear and specific, but sibling differentiation is left implicit.

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 mention of the prerequisite that a document must first be loaded (only implied by 'alias of the loaded document'). It does not explain why one would choose sum_values over min_max, jsonpath_query, or count for a related task.

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