LLM Output Validation

Parse AI output as JSON, repair common syntax mistakes and check supported schema rules. Returns parsed output and validation errors.

Pay by wallet (x402) llm-output-validate

Example

Example answer
{
  "valid": false,
  "errors": [],
  "auto_fixed": false,
  "error_count": 1,
  "parse_error": "Unexpected token 'e', \"test\" is not valid JSON",
  "parsed_output": null
}

Inputs

FieldTypeRequiredWhat it is
llm_outputstringYesRaw LLM output string
strict_modebooleanNo—
expected_schemaobjectNoJSON Schema to validate against

Output fields

How reliably each field appears in a successful answer.

FieldTypeAppears
validbooleanAlways (present in every successful answer)
errorsarrayAlways (present in every successful answer)
auto_fixedbooleanAlways (present in every successful answer)
parsed_outputanyAlways (present in every successful answer)
auto_fixed_outputstringUsually (present for most inputs)

How to call it

The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.

# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
  -H "Authorization: Bearer $STRALE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "capability_slug": "llm-output-validate",
    "inputs": {
      "llm_output": "{\"name\": \"Alice\", \"age\": 30, \"active\": true}"
    },
    "max_price_cents": 5
  }'

Limitations

  • Factual correctness is not checked

    Checks output structure and format only. It does not verify that the content is factually correct.

    What to do instead: Combine with domain-specific validation (e.g., schema checks, reference lookups) for factual verification

Related tools