Skip to main content
Glama

JSON diff (RFC 6902 patch)

json_diff
Read-onlyIdempotent

Compare two JSON documents and return the RFC 6902 JSON Patch that turns source into target, plus canonical SHA-256 of each side. Price: 0.01 USDC per successful call on Base via x402 (pass the signed payment in _meta['x402/payment']; failed calls are not charged). HTTP equivalent: POST https://json-canon-x402.fly.dev/v1/json-diff.

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": {
      "source": "<source>",
      "target": "<target>"
    },
    "name": "json_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYesOriginal JSON value (any type).
targetYesNew JSON value (any type).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds material context beyond them: the x402 payment requirement, the 0.01 USDC per-successful-call price on Base, the _meta['x402/payment'] handoff, and the fact that failed calls are free. It stops short of describing error behavior for malformed JSON or any size/rate limits.

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?

Three sentences, each carrying distinct load: what it does and returns, what it costs and how to pay, and where the HTTP equivalent lives. The core purpose is front-loaded and nothing is repeated from the title or schema.

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?

With no output schema, the description correctly carries the return contract (patch plus per-side SHA-256), and it discloses the payment/auth requirement an agent needs before invoking. The only real gap is failure-mode behavior for non-JSON or unparseable input.

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% and both parameters are self-explanatory ('Original JSON value' / 'New JSON value'). The phrase 'turns source into target' reinforces directionality of the diff, which is a small value-add, but no format, nesting, or edge-case semantics are supplied beyond the schema.

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 names a specific verb and resource ('Compare two JSON documents') and specifies the exact output artifact (RFC 6902 JSON Patch plus canonical SHA-256 of each side), which implicitly separates it from the sibling json_patch that applies patches. It never names that sibling outright, so differentiation is inferred rather than stated.

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 implied by the purpose: you call this when you need a patch describing the delta between two documents. There is no explicit when-to-use/when-not guidance and no mention of choosing between this and json_patch, so the agent must infer the boundary from the output type.

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