Skip to main content
Glama

Compare JSON documents

compare_json
Read-only

Use this when you want to compare two JSON documents, find changed JSON paths, or distinguish type changes from value changes. Ignores object key order, preserves array order, and compares decimal numbers without float rounding. Limits: 20,000 characters per document, depth 64, 4,000 values, 500 differences. Does not compare source code, YAML, JSON5, or duplicate-key documents.

Input Schema

NameRequiredDescriptionDefault
afterYesStrict JSON after the change, e.g. {"count":2,"enabled":"true"}.
beforeYesStrict JSON before the change, e.g. {"count":1,"enabled":true}. Do not include passwords or secrets.

Output Schema

NameRequiredDescriptionDefault
equalYes
countsYes
previewYes
downloadsYes
change_countYes
preview_noteYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already carry the safety profile (readOnlyHint, destructiveHint=false, openWorldHint=false), so the description correctly spends its budget elsewhere: it discloses comparison semantics (key order ignored, array order preserved, decimal comparison without float rounding) and hard limits (20,000 chars, depth 64, 4,000 values, 500 differences). These are traits neither the annotations nor the schema expose.

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?

Dense and front-loaded: purpose first, then semantics, then limits, then exclusions. Every sentence carries weight, though the limits list in one sentence is somewhat packed and could be scanned more easily as separate clauses.

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?

For a two-string-input comparison tool with an output schema present, the description covers what the agent needs: when to use, what is compared, what is ignored, and the operational ceilings. Return-value shape is delegated to the output schema, which is appropriate.

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; the description adds meaning beyond the schema by documenting processing limits (depth 64, 4,000 values, 500 differences) that constrain the inputs and predict truncation behavior. It does not add syntax guidance for before/after beyond what the schema already states.

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+resource (compare two JSON documents) plus the distinctive capability (find changed JSON paths, distinguish type changes from value changes). No siblings exist, so no differentiation is needed, but the capability is precise enough that an agent knows exactly what surface it covers.

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?

Explicitly names the triggers ('when you want to compare two JSON documents, find changed JSON paths') and then enumerates exclusions ('Does not compare source code, YAML, JSON5, or duplicate-key documents'). An agent can decide inclusion/exclusion without inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources