| name | structured-output-reliability |
| description | Get reliable structured output (JSON, typed objects) out of an LLM without regex repair, retry loops, or silent corruption. Use when the user is parsing model output, fighting malformed JSON, comparing JSON mode vs function calling vs structured outputs, or asks "why does the model keep breaking my schema?" / "how do I force valid JSON?". |
| tags | ["structured-output","reliability","tool-use","production"] |
Structured Output Reliability
If you're repairing model output with regex, your schema is the problem.
The model will produce malformed structured output. The question is whether your system fails closed (loud rejection) or open (silent corruption). The default of "parse and hope" produces the second.
When to use this skill
- The user is parsing JSON or typed objects out of a model and reports breakage.
- The user is regex-fixing model output (trailing commas, smart quotes, unescaped newlines).
- The user is comparing "JSON mode" / "structured outputs" / "function calling" / "tool use" for the same job.
- The user is building a pipeline where structured output feeds a downstream system.
The three mechanisms — pick by job
- Function calling / tool use. The model emits a structured argument to a tool. The provider enforces the schema. Strongest guarantees. Use when the structured output represents an action.
- Structured outputs / JSON schema mode. The provider constrains generation to your schema. Use when the structured output represents data — extraction, transformation, classification.
- Free-form JSON in text. Model emits JSON-like text inside a string response. Weakest guarantees. Use only when the above aren't available.