JSON pointer has
json-pointer-has · version 1.0.0 · JSON & JSONL · free, no key needed
Return whether an RFC 6901 pointer exists as an own path.
Use when you need to: json pointer has · has json pointer · json pointer exists.
Supported
- json pointer has
- has json pointer
- json pointer exists
Not supported
- prototype has
- 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.
- Same pointer grammar as json-pointer-get.
- present is true only if every token resolves through own properties or valid in-range array indexes.
- Invalid pointer syntax is invalid_input, not present false.
- Missing keys and out-of-range indexes yield present false. "-" is not present.
Input
json(any JSON value, required)pointer(string, required): max length 1024
Output
present(boolean, required)
Limits
- max json depth: 32
- max json nodes: 10000
- max pointer chars: 1024
Example
Request input:
{
"json": {
"a": [
1
]
},
"pointer": "/a/0"
}
Response:
{
"result": {
"present": true
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "json-pointer-has",
"version": "1.0.0",
"input": {
"json": {
"a": [
1
]
},
"pointer": "/a/0"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/json-pointer-has/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"json":{"a":[1]},"pointer":"/a/0"}'
The machine-readable contract is at /v1/tools/json-pointer-has/versions/1.0.0.
CLI
node cli.mjs run json-pointer-has 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- JSON flatten: Flatten a JSON value into a null-prototype map keyed by RFC 6901 JSON Pointers.
- JSON pointer get: Return the cloned JSON value at an RFC 6901 pointer.
- 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.
- Array to JSONL: Serialize an array of JSON-safe values as JSON Lines text.
- JSON array anti join: Anti join two JSON arrays of objects on exact keys.