perf_validate
Validates LLM-generated JSON against a schema, automatically repairing common violations like malformed enums, truncated arrays, and hallucinated fields. Returns compliant output or a detailed rejection.
Instructions
Validate LLM-generated JSON against a schema and auto-repair violations. Fixes malformed enums, truncated arrays, mixed types, hallucinated fields, and missing required properties. Returns valid, schema-compliant output or a detailed rejection.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"content": "<content>",
"target_schema": "<target_schema>"
},
"name": "perf_validate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The LLM-generated structured output (JSON string). | |
| target_schema | Yes | JSON Schema the output must conform to. | |
| repair_mode | No | 'strict' rejects low-confidence repairs. 'best_effort' infers to fill gaps. Default: 'best_effort'. |