Skip to main content
Glama

JSON canónico (RFC 8785)

json-canonicalize
Read-onlyIdempotent

Serializa JSON en forma canónica RFC 8785 (JCS) y devuelve su SHA-256. Cuándo: hay que transformar, comparar o revisar con exactitud datos estructurados (JSON, CSV, YAML, XML, arreglos). No para: ordenar recursivamente las claves de los objetos JSON sin cambiar el orden de los arreglos (json-sort-keys). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Serializes a JSON value in RFC 8785 (JCS) canonical form: sorted keys, no whitespace, ECMAScript number formatting; also returns its SHA-256 for signing or deduplication. When: structured data (JSON, CSV, YAML, XML, arrays) has to be transformed, compared or checked exactly. Not for: recursively sorting object keys (json-sort-keys). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
valueYesAny JSON value (any JSON value; required).

Output Schema

NameRequiredDescriptionDefault
sha256No
canonicalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / value / examples
      Added value: +[
      +  {
      +    "a": [
      +      1,
      +      1e+21,
      +      0.1
      +    ],
      +    "b": 2,
      +    "c": "é"
      +  }
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Serializes a JSON value in RFC 8785 (JCS) canonical form: sorted keys, no whitespace, ECMAScript number formatting; also returns its SHA-256 for signing or deduplication. When: structured data (JSON, CSV, YAML, XML, arrays) has to be transformed, compared or checked exactly. Not for: recursively sorting object keys (json-sort-keys). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive, and closed-world behavior, yet the description adds concrete operational context beyond them: no network access, no stored state, determinism, and hard limits (64 KB input, 1 s per call, 1 MB result). This is exactly the extra safety/limits context the annotations cannot express.

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?

The English portion is front-loaded and cleanly labeled (When / Not for / Side effects / Deterministic / Limits), with zero filler. The mirrored Spanish translation and the stray '[EN completo / full EN: inputSchema.description]' note add redundancy that keeps it just short of ideal.

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 single-parameter tool with an output schema (so return-value explanation is unnecessary) and rich annotations, the description covers purpose, usage, exclusions, side effects, determinism, and limits. 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.

Parameters3/5

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

Schema description coverage is 100% and the single 'value' parameter already includes an example and is documented, so the baseline is 3. The description's RFC 8785 details explain the transformation rather than adding meaning about the parameter itself, so it does not materially exceed the schema's own documentation.

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 (canonicalize/serialize) and resource (JSON value) plus the precise standard (RFC 8785 JCS) and its defining behaviors (sorted keys, no whitespace, ECMAScript number formatting, SHA-256 return). It explicitly distinguishes itself from the sibling json-sort-keys, so an agent can tell the two apart immediately.

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?

Provides explicit 'When:' conditions (transforming, comparing, or exactly checking structured data such as JSON, CSV, YAML, XML, arrays) and an explicit 'Not for:' exclusion naming the alternative json-sort-keys. Nothing is left 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