Skip to main content
Glama

json-canonicalize

JSON canonicalize. Any JSON document in, URL-encoded as the json query parameter (up to 12,000 bytes), one RFC 8785 (JCS) canonical form out: object keys sorted by UTF-16 code units, no insignificant whitespace, ECMAScript string and number forms, plus SHA-256 and SHA-512 digests of the canonical bytes for attestation. Price: $0.002 per call, paid in USDC on Base mainnet over x402; an unpaid call answers HTTP 402 with the exact machine-readable payment terms.

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": {
      "json": "<json>"
    },
    "name": "json-canonicalize"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsonYesThe JSON document to canonicalize, as text (up to 12,000 bytes).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden and does so well: it discloses the 12,000-byte input cap, the URL-encoded query-parameter transport, the paid x402 model with exact price and chain, and the HTTP 402 response with machine-readable terms on unpaid calls. What is missing is only secondary behavior such as error handling for malformed JSON or whether output is returned as a single object.

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?

One dense but well-ordered paragraph: purpose first, then input contract, then output semantics, then pricing. No filler sentences, though the output description and payment terms run together in a single long clause, which slightly hurts scannability.

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?

There is no output schema and no annotations, yet the description names the exact output (canonical form plus SHA-256 and SHA-512 digests) and the payment failure path. For a one-parameter transformation tool, an agent has everything needed to call it and understand the cost and result.

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% and there is a single parameter, so the baseline is 3; the description earns an extra point by explaining the transport detail that the schema omits — the document must be URL-encoded and passed as the 'json' query parameter with the same 12,000-byte ceiling.

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 and resource ('JSON canonicalize') and pins the exact standard: RFC 8785 JCS, keys sorted by UTF-16 code units, ECMAScript forms. That level of specificity distinguishes it cleanly from document-shaping siblings such as json-to-md or toml-parse.

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 phrase 'for attestation' and the deterministic-output framing, so an agent can infer this is the hashing/normalization tool. However, it never states when to prefer it over alternatives or when it is not appropriate (e.g., human-readable conversion), leaving that to 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