# 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, incomplete structures) so multi-agent pipelines can process them without crashing.

## Facts

- Endpoint: GET https://serp-extract.agentdiet.dev/v1/llm-json-schema-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-2090e16c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SP3SoONTfSMaGrFsPGOlr

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-2090e16c
```

Example prompt: This JSON from my LLM is broken — it has trailing commas, single quotes, and a markdown code fence around it. Can you repair it so I can parse it properly? Here it is: ```{'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline frequently receives malformed, truncated, or markdown-wrapped JSON that crashes downstream processing. It is especially useful when you cannot control the LLM output format directly and need a deterministic, cheap ($0.002/call) repair layer before schema validation or database ingestion. Prefer this over writing custom regex fixers or retrying the LLM call when speed and cost matter.

## Known failure modes

- Input so severely truncated or corrupted that valid repair is impossible — returns error or best-effort partial result
- Input that is not JSON at all (plain text, binary) — may return an error indicating non-JSON input
- Ambiguous repairs where multiple valid completions exist — deterministic repair may choose one interpretation that differs from original intent
- Very large JSON strings may hit query parameter length limits via GET method

## 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/llm-json-schema-healer)

## Output

Returns a repaired, valid JSON object derived from the malformed input — with syntax errors corrected, markdown fences stripped, trailing commas removed, single quotes converted to double quotes, and truncated structures closed. The output is immediately parseable by standard JSON libraries.

## 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-2090e16c/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)
