# 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 JSON strings (trailing commas, markdown fences, single quotes) produced by LLMs so multi-agent pipelines can process them without crashing.

## Facts

- Endpoint: GET https://serp-extract.agentdiet.dev/v1/schema-repair?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-bd265ee5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_g9_8p3F-KmPNv9iaqgTOf

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-bd265ee5
```

Example prompt: This JSON from the LLM came back broken — it has trailing commas, markdown code fences, and single quotes everywhere, and my pipeline keeps crashing. Can you deterministically repair it and give me valid JSON back? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when you need a fast, deterministic (non-AI) repair of LLM-generated JSON in a multi-agent or automation pipeline, especially when you cannot afford non-deterministic behavior or extra latency from a second LLM call. Prefer it over regex hacks or custom parsers when dealing with common LLM failure modes like trailing commas, markdown fences, and single quotes at scale.

## Known failure modes

- Input JSON is so severely malformed that deterministic repair is impossible — returns error or partial result
- Input string is not JSON at all (plain text, HTML, binary) — may return an error response
- Ambiguous truncation points where multiple valid completions exist — repair may be semantically incorrect
- Very long JSON strings may time out or exceed query parameter length limits via GET method
- Nested or deeply escaped JSON strings may confuse the parser

## 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/schema-repair)

## Output

A repaired, valid JSON object derived from the malformed input string, with all common LLM-introduced errors corrected including trailing commas removed, markdown code fences stripped, single quotes converted to double quotes, and truncated structures closed.

## 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-bd265ee5/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)
