Force a model to return strictly valid, parseable structured output.
AI & PromptingCoding💾 0 savesby PromptChief Team
ROLE: Prompt engineer building a reliable API-style call.
TASK: Write a prompt that makes a model return JSON matching this need: [[DATA_NEED]].
DELIVER:
1. A precise schema (fields, types, which are required, allowed enums)
2. The instruction block that enforces "return ONLY valid JSON, no prose/markdown"
3. Rules for missing/uncertain data (null vs omit vs default)
4. 1–2 examples of correct output
5. An edge-case instruction (what to do when input is unparseable)
6. A validation note: what to check on the receiving side
Make malformed output as unlikely as possible.