Self-Correcting Schema Agent
Repair structured output against a fixed JSON Schema with bounded retries.
Get schema-valid output or an explicit failure with validation errors.
Free · 2 KB · SKILL.md, instructions and example files. Requires the schema, a validator and an assistant capable of revising the output.
A worked example
A small example to try before using your own data.
Input
{
"schema": {
"type": "object",
"properties": {
"count": {
"type": "integer"
}
},
"required": [
"count"
],
"additionalProperties": false
},
"candidate": {
"count": "3"
},
"source": "There are three items.",
"attempt_budget": 2
}Expected result
{
"count": 3
}What to check: The repaired value is an integer supported by the source, the schema is unchanged and an independent validator accepts the result.
Limits: Schema validity does not establish factual correctness. Retries and API costs remain the caller’s responsibility.
Worked example included. Model-specific performance and vendor compatibility have not been benchmarked.
🧠 Why it works
The repaired value is an integer supported by the source, the schema is unchanged and an independent validator accepts the result.
⚙️ How it works
- Validate the schema itself, then freeze it for the run; do not weaken requirements to make output pass.
- Validate the proposed JSON and return concrete error paths to the repair step.
- Repair only the failing structure while preserving supported source facts.
- Repeat within the stated attempt budget and validate each result independently.
- If the budget is exhausted, return failure and the last errors; never label invalid JSON successful.
Description
Get schema-valid output or an explicit failure with validation errors.
Requires the schema, a validator and an assistant capable of revising the output.
Limits: Schema validity does not establish factual correctness. Retries and API costs remain the caller’s responsibility.
Recommended Use
Sign in to suggestTools and workflow packs this skill pairs well with. Forge picks are auto-generated from category + capability signals; Community picks are added by people who've used the pairing.
No matches yet. Be the first to suggest a pairing, or the Forge will populate suggestions as signals align.
Report compatibility
Tell the community which tool you used this skill with, and whether it worked.
Suggest a pairing
Recommend a tool or workflow pack that this skill works well with. Up to 5 recommendations per day.