Skip to main content
Glama

Aplicar JSON Patch (RFC 6902)

json-patch-apply
Read-onlyIdempotent

Aplica un JSON Patch (RFC 6902) de forma atómica; si una operación falla, no se aplica nada. Cuándo: hay que transformar, comparar o revisar con exactitud datos estructurados (JSON, CSV, YAML, XML, arreglos). No para: calcular un JSON Patch (json-diff-patch). 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: Applies an RFC 6902 JSON Patch (add, remove, replace, move, copy, test) atomically to a document; any failing operation aborts the whole patch. When: structured data (JSON, CSV, YAML, XML, arrays) has to be transformed, compared or checked exactly. Not for: computing an RFC 6902 JSON Patch that transforms document a into document b (json-diff-patch). 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.

Input Schema

NameRequiredDescriptionDefault
patchYesPatch operations (max 1,000; result max 200,000 nodes) (array of object; required; up to 1000 items).
valueYesTarget document (any JSON value; required).

Output Schema

NameRequiredDescriptionDefault
valueNoany JSON value

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / patch / examples
      Added value: +[
      +  [
      +    {
      +      "op": "replace",
      +      "path": "/a",
      +      "value": 2
      +    },
      +    {
      +      "op": "add",
      +      "path": "/list/-",
      +      "value": 3
      +    },
      +    {
      +      "op": "remove",
      +      "path": "/list/0"
      +    }
      +  ]
      +]
    • addedInput schema / properties / value / examples
      Added value: +[
      +  {
      +    "a": 1,
      +    "list": [
      +      1,
      +      2
      +    ]
      +  }
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/destructive/closed-world, and the description still adds meaningful behavior beyond them: atomic all-or-nothing semantics on failure, determinism, no network or stored state, and concrete limits (64 KB input, 1 s, 1 MB result). The atomicity guarantee is the single most important behavioral fact for a patch tool and it is stated up front.

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 content is front-loaded and organized into labeled clauses (When / Not for / Side effects / Deterministic / Limits), which scans well. The full Spanish/English duplication doubles the length, which is useful for human readers but redundant for an agent consuming one language.

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?

An output schema exists so return structure need not be described. Combined with atomicity, determinism, resource limits, and the explicit exclusion of json-diff-patch, nothing an agent needs to invoke this 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%, so both parameters and the nested op object are already documented, which sets the baseline at 3. The description adds little parameter-level detail beyond restating the operation set — the 64 KB input cap is the main extra fact — so it does not meaningfully exceed the schema.

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 ('Applies an RFC 6902 JSON Patch'), enumerates the supported operations (add, remove, replace, move, copy, test), and explicitly names the sibling it is not (json-diff-patch). An agent can distinguish it from json-merge-patch-apply or json-diff-patch without opening any schema.

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:' (transforming/comparing/checking structured data) and 'Not for:' with a named alternative (json-diff-patch for computing a patch). This is exactly the routing information an agent needs to choose between the two patch-related siblings.

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