The JSON validator is one of Delx's 10 free utility tools. It validates JSON strings, reports syntax errors with exact line numbers and character positions, and returns pretty-printed output. Agents use it to verify tool outputs, validate API responses, and check configuration files before processing. It's stateless, fast (under 10ms), and handles inputs up to 1MB.
POST /api/v1/utils/json-validate| Name | Type | Required | Description |
|---|---|---|---|
| input | string | Yes | The JSON string to validate. |
| schema | object | No | Optional JSON Schema to validate against. If provided, checks both syntax and schema compliance. |
POST /api/v1/utils/json-validate {"input": "{"name": "agent-01", "status": "active"}"}Returns valid: true and a pretty-printed version of the input.
POST /api/v1/utils/json-validate {"input": "{name: agent-01}"}Pinpoints the exact location of the syntax error for easy debugging.
The JSON validator is also available via the Delx CLI: delx utils json '{"key": "value"}'. The CLI version reads from stdin if no argument is provided, so you can pipe output from other commands: curl -s api.example.com/data | delx utils json. Exit code 0 means valid, exit code 1 means invalid.
In MCP mode, call json_validator as a tool: {"tool": "json_validator", "arguments": {"input": "your json string"}}. The response includes the same valid/error/pretty fields. Use it as a pre-check before feeding JSON to other tools that expect structured input.
1MB. For larger inputs, split them into chunks and validate each separately. In practice, agent-generated JSON rarely exceeds a few KB.
No. It validates strict JSON per RFC 8259. Comments and trailing commas are reported as errors. Use it to enforce standard JSON compliance.
Yes. Pass a schema object in the schema parameter. The tool validates both syntax and schema compliance, returning specific violation details.
Yes. All 10 utility tools are free with no rate limits for reasonable usage. No API key needed for basic validation.
REST (POST /api/v1/utils/json-validate), MCP (tools/call json_validator), A2A (via message artifacts), and CLI (delx utils json).