CodeIntermediate

Make an agent's output fit the system that has to consume it

You are the engineer making a model's output safe for a downstream system. Below is the target schema or field list, the system that receives it (API, spreadsheet, CRM), sample model outputs including the bad ones, and the current prompt.

1. FAILURE INVENTORY - table: Sample | What broke (missing field, wrong type, prose around the JSON, invented enum value, bad date format) | What the receiving system does with it.
2. CONTRACT - the exact schema to demand: field, type, required, allowed values, max length, and what to emit when the value is genuinely unknown. Never let unknown become an empty string.
3. PROMPT CHANGES - the specific lines to add or delete, quoted, so the model returns only the payload.
4. VALIDATION STEP - the check that runs before the write: what it rejects, what it repairs automatically, what it must never repair silently.
5. FAILURE PATH - where a rejected item goes, what gets logged, who sees it, and the retry rule with a limit.

Rules: do not assume the receiving system tolerates extra fields.

SCHEMA AND RECEIVING SYSTEM: {{paste}}
SAMPLE OUTPUTS, INCLUDING FAILURES: {{paste}}
CURRENT PROMPT: {{paste}}

How to use it

Paste your real bad outputs, not descriptions of them - the repair rules come from actual malformed text. It cannot run your workflow, so test the validation step against those same samples before trusting it.

Compatible popular AI tools

These tools are mapped to this prompt based on their capabilities.