JSON pick pointers
json-pick-pointers · version 1.0.0 · JSON & JSONL · free, no key needed
Pick cloned JSON values at explicit RFC 6901 pointers into a null-prototype map.
Use when you need to: json pick pointers · project json pointers · select json pointers.
Supported
- json pick pointers
- project json pointers
- select json pointers
Not supported
- reconstruct nested tree
- create missing
- json patch
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.
- pointers is a non-empty unique list. Duplicate pointers are invalid_input.
- Each pointer is resolved as json-pointer-get. Missing paths are invalid_input.
- Result values is a null-prototype object whose own keys are the pointer strings and whose values are deep clones.
- Pointer strings used as keys, including empty string for root, are ordinary own keys.
Input
json(any JSON value, required)pointers(array of string, required): min items 1; max items 256; each max length 1024
Output
values(object, required)
Limits
- max json depth: 32
- max json nodes: 10000
- max pointers: 256
- max pointer chars: 1024
Example
Request input:
{
"json": {
"a": 1,
"b": {
"c": 2
}
},
"pointers": [
"/a",
"/b/c"
]
}
Response:
{
"result": {
"values": {
"/a": 1,
"/b/c": 2
}
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "json-pick-pointers",
"version": "1.0.0",
"input": {
"json": {
"a": 1,
"b": {
"c": 2
}
},
"pointers": [
"/a",
"/b/c"
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/json-pick-pointers/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"json":{"a":1,"b":{"c":2}},"pointers":["/a","/b/c"]}'
The machine-readable contract is at /v1/tools/json-pick-pointers/versions/1.0.0.
CLI
node cli.mjs run json-pick-pointers 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- JSON array project: Select specific keys from each object in a JSON array.
- JSON array filter equals: Filter JSON array objects where a key equals a specific value.
- JSON flatten: Flatten a JSON value into a null-prototype map keyed by RFC 6901 JSON Pointers.
- JSON omit pointers: Deep-clone JSON and delete values at explicit RFC 6901 pointers.
- JSON pointer list: List RFC 6901 pointers to every reachable JSON node, root first.
- JSON unflatten: Reconstruct a JSON value from a map of RFC 6901 JSON Pointers to leaves.