# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from serp-extract.agentdiet.dev, paid per call via MPP, $0.002/call, status unknown (last checked 2026-10-21).

Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines can reliably parse LLM responses without crashing.

## Facts

- Endpoint: GET https://serp-extract.agentdiet.dev/v1/malformed-json-healer?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: serp-extract.agentdiet.dev
- Website: https://serp-extract.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-d5c06921
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_S2KpJob9wh10IzPdCjSI9

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-d5c06921
```

Example prompt: This JSON response from my LLM has trailing commas and markdown code fences and won't parse — can you repair it so I get a valid JSON object back? Here's the raw string: ```json {"name": "Alice", "age": 30,} ```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives malformed JSON from LLM outputs and needs a deterministic, rule-based repair (not a generative rewrite). Ideal when you need reliable, reproducible fixes for common LLM formatting artifacts like markdown fences, trailing commas, and single quotes, and want to avoid sending the broken JSON back to another LLM for correction.

## Known failure modes

- Input is so corrupted that deterministic repair is impossible — returns error indicating unrecoverable JSON
- raw_json parameter missing or empty — returns 400 validation error
- Input is not JSON at all (plain text, binary data) — may return error or unexpected output
- Extremely long truncated inputs may hit size limits
- Payment not provided or failed — returns HTTP 402 requiring x402 micropayment

## How this service works

Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash. (Live x402 v2, IETF MPP & MCP endpoint at https://serp-extract.agentdiet.dev/v1/malformed-json-healer)

## Output

A repaired, valid JSON object with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures properly closed — ready for downstream parsing and processing.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "raw_json"
 ],
 "properties": {
  "limit": {
   "type": "integer",
   "default": 20,
   "maximum": 100,
   "minimum": 1,
   "description": "Maximum number of items to return per page (1-100)"
  },
  "cursor": {
   "type": "string",
   "description": "Opaque pagination cursor for fetching the next page"
  },
  "raw_json": {
   "type": "string",
   "minLength": 1,
   "description": "Malformed, truncated, or markdown-wrapped JSON string to deterministically repair"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/serp-extract-agentdiet-dev-deterministic-a2a-broken-json-repair-d5c06921/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from serp-extract.agentdiet.dev](https://www.zero.xyz/host/serp-extract.agentdiet.dev/llms.txt)
