AI infrastructure & agent explorers

Structured Output Validator

Validate AI JSON output against a JSON Schema: parse errors with line/column, plain-language fixes.

Plain schema or a response_format / function-tool wrapper.

Raw model output; code fences and prose around the JSON are handled.

Try an example: Fenced output with trailing comma, string number and unknown property · Broken JSON (missing comma) – exact error position

How it works

Paste a JSON Schema (or an OpenAI/Anthropic/MCP wrapper around one) and the model's output. The tool extracts the JSON from markdown code fences or surrounding prose, reports syntax errors with exact line and column, validates against a draft 2020-12 subset (types, required, additionalProperties, enum, const, ranges, lengths, patterns, items, anyOf/oneOf/allOf, local $ref and more) with human explanations and hints for typical LLM mistakes, and suggests a repaired JSON only for trivial issues such as code fences or trailing commas.

  • Extraction: raw JSON if the output starts with { or [; otherwise the first ```json (or JSON-looking) code fence; otherwise the first balanced {…} / […] in the prose.
  • Parsing uses a strict RFC 8259 parser that reports the first error with line and column in your original text (single quotes, unquoted keys, NaN/None/True, trailing commas, unescaped line breaks are named explicitly).
  • Repair is attempted only for trivial issues – removing code fences/prose and trailing commas. Anything else is reported, never guessed. Validation then runs on the repaired JSON and says so.
  • Validation implements the draft 2020-12 core used by structured-output APIs: type, enum, const, properties, required, additionalProperties, patternProperties, propertyNames, min/maxProperties, items, prefixItems, contains, min/maxItems, uniqueItems, minimum/maximum (incl. exclusive), multipleOf, min/maxLength, pattern, anyOf, oneOf, allOf, not, if/then/else, dependentRequired and local $ref. format is checked for common formats and reported as a warning. Unknown keywords are listed as not checked.
  • Wrappers (OpenAI response_format/json_schema, Responses text.format, function tools, Anthropic input_schema, MCP inputSchema) are unwrapped; with strict: true the OpenAI strict-mode rules (closed objects, all properties required) are checked too.

For scripts and AI agents

  • JSON API: POST https://structuredoutputvalidator.usefulweb.site/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://structuredoutputvalidator.usefulweb.site/mcp · tool name structured_output_validator
Example request
curl -s -X POST https://structuredoutputvalidator.usefulweb.site/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{…see OpenAPI examples…}'

Related tools

Feedback