JSON schema instance locate

json-schema-instance-locate · version 1.0.0 · JSON & JSONL · free, no key needed

Resolve RFC 6901 instance locations (string or URI fragment) from schema errors to values, or say why they fail.

Use when you need to: show the offending values at json schema error instance locations · resolve instance_location pointers from validation errors · convert json pointer to uri fragment identifier and resolve it.

Decide before calling

Read the versioned contract and the supported scope below. Reuse json-schema-instance-locate@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-schema-instance-locate@1.0.0 for show the offending values at json schema error instance locations. 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

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "instance": {
    "items": [
      {
        "price": "12"
      }
    ],
    "a/b": 1
  },
  "locations": [
    "/items/0/price",
    "#/a~1b",
    "/items/1"
  ]
}

Response:

{
  "result": {
    "results": [
      {
        "location": "/items/0/price",
        "pointer": "/items/0/price",
        "uri_fragment": "#/items/0/price",
        "found": true,
        "value": "12"
      },
      {
        "location": "#/a~1b",
        "pointer": "/a~1b",
        "uri_fragment": "#/a~1b",
        "found": true,
        "value": 1
      },
      {
        "location": "/items/1",
        "pointer": "/items/1",
        "uri_fragment": "#/items/1",
        "found": false,
        "reason": "index_out_of_range",
        "matched_pointer": "/items"
      }
    ]
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "json-schema-instance-locate",
  "version": "1.0.0",
  "input": {
    "instance": {
      "items": [
        {
          "price": "12"
        }
      ],
      "a/b": 1
    },
    "locations": [
      "/items/0/price",
      "#/a~1b",
      "/items/1"
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/json-schema-instance-locate/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"instance":{"items":[{"price":"12"}],"a/b":1},"locations":["/items/0/price","#/a~1b","/items/1"]}'

The machine-readable contract is at /v1/tools/json-schema-instance-locate/versions/1.0.0.

CLI

node cli.mjs run json-schema-instance-locate 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.