JSON pointer get
json-pointer-get · version 1.0.0 · JSON & JSONL · free, no key needed
Return the cloned JSON value at an RFC 6901 pointer.
Use when you need to: json pointer get · get json pointer · read json pointer.
Decide before calling
Read the versioned contract and the supported scope below. Reuse json-pointer-get@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-pointer-get@1.0.0 for json pointer get. 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
- json pointer get
- get json pointer
- read json pointer
Not supported
- json patch
- create missing
- prototype walk
- fetch
Behavior
- Accept only JSON values: null, boolean, finite number, string, array, and plain objects.
- Reject NaN, Infinity, -Infinity, undefined, BigInt, functions, symbols, Date, Map, Set, RegExp, boxed primitives, Buffer, and sparse holes.
- Canonicalize -0 to 0.
- Objects may have null or Object.prototype; use own enumerable string keys only.
- Treat __proto__, constructor, and toString as ordinary own keys. Never mutate Object.prototype.
- Output objects must be Object.create(null). Deep-clone all returned JSON values.
- Bound walk: max depth 32, max nodes 10000, max UTF-8 JSON bytes 250KiB of the input document string if provided as text; when json is already a value, bound the walked node count and depth.
- pointer is RFC 6901. Empty pointer returns a clone of the whole value.
- Tokens: split on /, reject pointer not empty and not starting with /.
- ~0 decodes to ~ and ~1 to /. A ~ not followed by 0 or 1 is invalid.
- On objects, use Object.hasOwn only. Array tokens must be "0" or [1-9][0-9]* with no leading zeros. "-" is not an existing index.
- Missing path, out-of-range index, or indexing a primitive is invalid_input.
Input
json(any JSON value, required)pointer(string, required): max length 1024
Output
value(any JSON value, required)
Limits
- max json depth: 32
- max json nodes: 10000
- max pointer chars: 1024
Example
Request input:
{
"json": {
"a": [
{
"b": 1
}
]
},
"pointer": "/a/0/b"
}
Response:
{
"result": {
"value": 1
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "json-pointer-get",
"version": "1.0.0",
"input": {
"json": {
"a": [
{
"b": 1
}
]
},
"pointer": "/a/0/b"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/json-pointer-get/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"json":{"a":[{"b":1}]},"pointer":"/a/0/b"}'
The machine-readable contract is at /v1/tools/json-pointer-get/versions/1.0.0.
CLI
node cli.mjs run json-pointer-get 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- JSON fence extract: List Markdown fenced code blocks (CommonMark 0.31.2) with exact spans, unwrapped content and an RFC 8259 JSON check.
- JSON flatten: Flatten a JSON value into a null-prototype map keyed by RFC 6901 JSON Pointers.
- JSON keyed array merge: Three-way merge JSON arrays by a JSON Pointer key, returning edits, moves, inserts, deletes, and conflicts.
- JSON pointer has: Return whether an RFC 6901 pointer exists as an own path.
- JSON pointer list: List RFC 6901 pointers to every reachable JSON node, root first.
- JSON schema additional find: Find every member a JSON Schema 2020-12 "additionalProperties": false forbids, with the member's JSON Pointer.