// make.com integration

AI JSON Parser (Clean & Repair)

The AI JSON Parser module parses messy or AI-generated JSON in Make.com. It strips markdown code fences from ChatGPT, Claude or Gemini output, extracts the JSON block from surrounding prose, and repairs common issues that would otherwise break your scenario.

How it works

AI modules rarely return clean JSON. They wrap it in ```json fences, add explanations before and after, use smart quotes, or leave trailing commas. Make's built-in JSON parse module throws an error on all of these inputs, and your scenario stops.

This module cleans the text step by step before parsing:

  1. Strips markdown code fences (```json ... ```) around the payload
  2. Extracts the JSON block when it is embedded in prose like "Here is your result: {...} Let me know if..."
  3. Unwraps double-serialized strings, i.e. JSON that was encoded as a JSON string ("stringified twice")
  4. Removes trailing commas before } and ]
  5. Replaces smart quotes (“ ” ‘ ’) with straight quotes
  6. Converts Python and JavaScript literals: True, False, None, NaN and undefined become valid JSON values

If a fix was applied, the output tells you exactly what happened.

Module Fields

FieldDescriptionHow to use it
ConnectionLinks the module to the CustomJS serviceSelect or create a connection using your API key
JSON TextRaw text that should contain JSONMap the output of an AI module (ChatGPT, Claude, Gemini) or any other text source. Code fences and surrounding prose are removed automatically
Strict mode (no content repairs)Limits cleanup to structural stepsBoolean, default off. When on, only fence stripping, JSON block extraction and double-encoding unwrap are applied. Content repairs (smart quotes, trailing commas, Python literals like True, False, None) are skipped, and invalid JSON throws an error

Usage example

A typical ChatGPT response mapped into JSON Text:

Input:

Sure! Here is the extracted data:

```json
{
  "name": "Acme Corp",
  "active": True,
  "tags": ["b2b", "enterprise",],
}
```

Let me know if you need anything else.

Output (Parsed JSON):

{
  "name": "Acme Corp",
  "active": true,
  "tags": ["b2b", "enterprise"]
}

Repair Notes would list the removed code fence, the converted True literal and the removed trailing commas.

Output

OutputDescription
Parsed JSONThe parsed result, ready to map into any following module
Was RepairedBoolean, true if any cleanup or repair step changed the input
Repair NotesAn array of text entries describing exactly what was fixed

Good to know

  • Use it right after every AI module that is supposed to return structured data. It makes AI scenarios resilient instead of failing on the first malformed response.
  • Strict mode is for validation. Turn it on when you want to detect broken AI output instead of silently repairing it, for example to route errors to a fallback path.
  • Make's built-in JSON parse module throws on fenced, quoted or comma-broken input. This module is the drop-in replacement for AI pipelines.

See the Make.com integration overview for setup instructions, and check out the other utility modules: Group & Aggregate Array, Parse Localized Number, Format Date & Convert Timezone and File to Base64. More cleanup recipes are in Data cleanup snippets for Make.