# JSON patch test only

`json-patch-test-only` · version 1.0.0 · JSON & JSONL · free, no key needed

Evaluate only RFC 6902 test operations without modifying JSON; returns each test result and whether all passed.

**Use when you need to: evaluate only JSON patch test operations · check JSON patch assertions without applying changes · run RFC 6902 tests safely.**

## Decide before calling

Read the [versioned contract](/v1/tools/json-patch-test-only/versions/1.0.0) and the supported scope below. Reuse `json-patch-test-only@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `json-patch-test-only@1.0.0` for evaluate only JSON patch test operations. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- evaluate only JSON patch test operations
- check JSON patch assertions without applying changes
- run RFC 6902 tests safely
- verify JSON values at patch pointers
- inspect which patch tests pass
- ignore mutations and evaluate patch tests

## Not supported

- apply mutating patch operations
- generate a patch between documents

## Behavior

- Unrecognized operation members are ignored (RFC 6902 section 4); only the members defined for that op are interpreted. This read-only tool evaluates tests against the original document and ignores mutating operations, including removal at the document root.
- Implements RFC 6902 (April 2013), Sections 4 and 5, with JSON Pointer syntax from RFC 6901 (April 2013), Sections 3 and 4.
- Inputs are JSON values; object keys are compared exactly and arrays are ordered. Processing is synchronous and deterministic.
- Limits are checked before or during bounded traversal; no network, filesystem, clock, locale, or randomness is used.

## Input

- `document` (any JSON value, required)
- `patch` (array of object, required): max items 128

## Output

- `standard_version` (constant "RFC 6902 (April 2013); RFC 6901 (April 2013)", required)
- `all_passed` (boolean, required)
- `tests` (array of object, required): max items 128

## Limits

- max input bytes: 65536
- max operations: 128
- max depth: 32
- max output bytes: 131072
- max iterations: 4096

## Example

Request input:

```json
{
  "document": {
    "a": 1
  },
  "patch": [
    {
      "op": "test",
      "path": "/a",
      "value": 1
    }
  ]
}
```

Response:

```json
{
  "result": {
    "standard_version": "RFC 6902 (April 2013); RFC 6901 (April 2013)",
    "all_passed": true,
    "tests": [
      {
        "index": 0,
        "path": "/a",
        "passed": true
      }
    ]
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "json-patch-test-only",
  "version": "1.0.0",
  "input": {
    "document": {
      "a": 1
    },
    "patch": [
      {
        "op": "test",
        "path": "/a",
        "value": 1
      }
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/json-patch-test-only/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"document":{"a":1},"patch":[{"op":"test","path":"/a","value":1}]}'
```

The machine-readable contract is at [/v1/tools/json-patch-test-only/versions/1.0.0](/v1/tools/json-patch-test-only/versions/1.0.0).

### CLI

```sh
node cli.mjs run json-patch-test-only 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [JSON patch apply](/tools/json-patch-apply): Apply an RFC 6902 JSON Patch atomically; returns the document or the failing operation index and pointer.
- [JSON patch diff](/tools/json-patch-diff): Generate a deterministic RFC 6902 patch from two JSON documents; returns the ordered patch operations.
- [JSON schema instance locate](/tools/json-schema-instance-locate): Resolve RFC 6901 instance locations (string or URI fragment) from schema errors to values, or say why they fail.
- [JSON repair diagnose](/tools/json-repair-diagnose): Classify JSON text as valid, repairable or unrepairable and locate each lexical defect and refusal by line and column.
- [JSON schema output validate](/tools/json-schema-output-validate): Validate JSON (e.g. LLM output) against a Draft 2020-12 schema subset; returns spec output units with JSON Pointers.
- [JSON schema required missing](/tools/json-schema-required-missing): List every property a JSON Schema 2020-12 "required" keyword demands but the instance lacks, with JSON Pointers.
