Skip to main content
Glama

TestingAPIs API tools

Compare two JSON documents

compare_json
Read-onlyIdempotent

List the differences between two JSON documents by their data, not their text: key order never counts, and array order can be ignored. Each difference has its JSONPath and both values.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "original": "<original>",
      "changed": "<changed>"
    },
    "name": "compare_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
changedYesThe second JSON document.
originalYesThe first JSON document.
ignoreArrayOrderNoMatch array items by content instead of position.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description contributes genuinely new behavioral detail: comparison is structural, key order is irrelevant, and each difference returns its JSONPath with both values — valuable given there is no output schema. It does not say what happens with malformed JSON or how array-order handling is chosen, leaving gaps beyond the annotation coverage.

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?

Two sentences, no filler. The core operation is front-loaded in the first clause and the clarifying semantics follow immediately; the return shape is packed into one short trailing sentence.

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?

For a three-parameter, annotation-covered, output-schema-less tool, this covers the essentials: what a diff result looks like and that comparison is structural. The remaining gaps are the default for ignoreArrayOrder and error behavior on invalid JSON input, which are relevant given both inputs are large string payloads.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents original, changed, and ignoreArrayOrder, making 3 the baseline. The description adds conceptual meaning about order-insensitivity, but it blurs the parameter: "array order can be ignored" reads as an unconditional property while array-order tolerance is actually opt-in via ignoreArrayOrder, and the default is never stated.

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?

"List the differences between two JSON documents by their data, not their text" gives a concrete verb (list the differences) and a specific resource (two JSON documents), and the semantic-diff framing separates it from text-based diff or from validation siblings like validate_json_schema. It stops short of naming any sibling explicitly, so it lands at clear-but-undifferentiated.

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: the reader infers you call this when you want a semantic diff rather than a textual one. There is no statement of when not to use it (e.g. for schema validation or path queries, which the siblings cover) and no prerequisites such as both inputs needing to be valid JSON.

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