Skip to main content
Glama

Validate + canonicalize JSON

validate_json
Read-onlyIdempotent

Validate a JSON instance against an optional JSON Schema and return RFC 8785 canonical JSON plus SHA-256. 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/validate.

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": {
      "instance": "<instance>"
    },
    "name": "validate_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
schemaNoJSON Schema to validate instance against. Optional. If omitted, the instance is accepted and only canonicalized.
instanceYesJSON value to validate. Any JSON type is accepted.
canonicalizeNoIf true (default), return RFC 8785 JCS canonical JSON, its SHA-256 hex digest, and byte length.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare it a safe, idempotent, closed-world read, so the description correctly focuses on what annotations cannot convey: cost (0.01 USDC per successful call on Base via x402), that failed calls are free, where the signed payment must go (_meta['x402/payment']), and the HTTP equivalent endpoint. It also discloses the return payload (canonical JSON, SHA-256 hex, byte length), which no output schema exists to cover.

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?

Front-loaded with the core action and return values, with the pricing/payment and HTTP details following in a compact second half. It is dense but every sentence carries operational information an agent needs; only the HTTP endpoint line is somewhat peripheral for MCP use.

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 three-parameter tool with full schema coverage and no output schema, the description covers purpose, return values, cost, and payment mechanics. Nothing an agent needs to invoke it correctly is missing.

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 baseline is 3; the description earns above that by documenting the out-of-schema payment channel, telling the agent that the x402 payment is passed in _meta rather than in the arguments object even though the schema forbids additional properties. The canonicalize toggle's effect is left to the schema text.

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?

The description names a specific verb and resource ('Validate a JSON instance against an optional JSON Schema') and states the exact outputs ('RFC 8785 canonical JSON plus SHA-256'). This is clearly distinct from the sibling diff/patch/conversion tools, so an agent can select it without opening the schema.

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?

The optional-schema behavior is stated ('If omitted, the instance is accepted and only canonicalized'), which implies the two usage modes, but the description never explicitly says when to prefer this tool over json_diff or json_patch. Usage is inferable from the purpose rather than spelled out.

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