JSONL validate
jsonl-validate · version 1.0.0 · JSON & JSONL · free, no key needed
Validate strict JSON Lines text and report the value count and UTF-8 byte length.
Use when you need to: jsonl validate · validate json lines · check jsonl document.
Supported
- jsonl validate
- validate json lines
- check jsonl document
Not supported
- JSONL comments
- concatenated JSON without newlines
- NDJSON with blank lines
- JSON schema validation
- return valid false
- read files
Behavior
- text is strict JSON Lines split on CRLF, CR, or LF.
- A trailing empty segment after a final newline is ignored; internal empty lines are rejected.
- A document that is empty or only a trailing newline has zero JSON values.
- At most 5000 lines are accepted.
- Each line is parsed with JSON.parse and must be a JSON-safe value: object, array, string, boolean, null, or safe integer.
- Non-finite numbers, non-integers, and integers outside Number.MAX_SAFE_INTEGER are rejected.
- On success the output is valid true, the JSON value count, and the UTF-8 byte length of text.
- Invalid JSONL throws; the tool never returns valid false.
Input
text(string, required): max length 256000
Output
valid(constant true, required)lines(integer, required): min 0; max 5000bytes(integer, required): min 0; max 256000
Limits
- max input bytes: 256000
- max lines: 5000
Example
Request input:
{
"text": "{\"name\":\"Ada\",\"ok\":true}\n\"שלום\"\n0\nnull\n"
}
Response:
{
"result": {
"valid": true,
"lines": 4,
"bytes": 43
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "jsonl-validate",
"version": "1.0.0",
"input": {
"text": "{\"name\":\"Ada\",\"ok\":true}\n\"שלום\"\n0\nnull\n"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/jsonl-validate/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"text":"{\"name\":\"Ada\",\"ok\":true}\n\"שלום\"\n0\nnull\n"}'
The machine-readable contract is at /v1/tools/jsonl-validate/versions/1.0.0.
CLI
node cli.mjs run jsonl-validate 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Array to JSONL: Serialize an array of JSON-safe values as JSON Lines text.
- JSON schema validate: Validate a JSON instance against ComputeFirst Schema 1.0.
- JSONL to array: Parse strict JSON Lines text into an array of JSON-safe values.
- JSON array anti join: Anti join two JSON arrays of objects on exact keys.
- JSON array concat: Concatenate multiple JSON arrays of objects into one.
- JSON array count: Count structural occurrences in a JSON array in first-seen order.