# Deterministic A2A Broken-JSON Repair & Schema Validator

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

Deterministically repairs malformed, truncated, or markdown-wrapped JSON strings from LLM outputs so multi-agent pipelines never crash on bad JSON.

## Facts

- Endpoint: GET https://json-repair.agentdiet.dev/.well-known/agent-card.json?utm_source=zero.xyz
- Price: $0.002000/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-28
- Activations on Zero: 0
- Provider: json-repair.agentdiet.dev
- Website: https://json-repair.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/json-repair-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-cc420186
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BDJvH6lxtfJSkrigLNf02

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 json-repair-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-cc420186
```

Example prompt: This JSON from the LLM response is broken — it has trailing commas, markdown fences, and single quotes instead of double quotes. Can you repair it so I can use it in my pipeline? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives JSON from an LLM or tool that is syntactically invalid due to truncation, trailing commas, markdown fences, or single-quote usage, and you need a deterministic (not AI-based) fix that is predictable and safe to use in automated workflows. Prefer this over asking an LLM to re-generate the JSON when you need guaranteed determinism and low latency.

## Known failure modes

- Input is so severely malformed that deterministic repair is impossible — returns error or best-effort partial result
- raw_json field is empty or missing — returns 400 validation error
- Input is already valid JSON — returns it unchanged (no-op)
- Extremely large or deeply nested JSON may hit processing limits

## 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://json-repair.agentdiet.dev/.well-known/agent-card.json)

## Output

A repaired, syntactically valid JSON object or string with trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncations closed — ready for downstream parsing and consumption by agent pipelines.

## 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/json-repair-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-cc420186/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from json-repair.agentdiet.dev](https://www.zero.xyz/host/json-repair.agentdiet.dev/llms.txt)
