# Deterministic A2A Broken-JSON Repair & Schema Validator

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

Repairs malformed, truncated, or improperly formatted LLM JSON outputs (trailing commas, markdown fences, single quotes) into valid, parseable JSON so multi-agent pipelines don't crash.

## Facts

- Endpoint: GET https://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: agentdiet.dev
- Website: https://agentdiet.dev
- Canonical page: https://www.zero.xyz/c/agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-f54a1614
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CYBeOGlScvVzonrEZcPVN

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

Example prompt: This JSON from the LLM response is broken — it has trailing commas and markdown fences around it. Can you repair it and give me back valid, parseable JSON? Here's the raw string: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline is receiving JSON outputs that are systematically malformed in predictable ways (trailing commas, markdown wrapping, single quotes, minor truncations) and you need a deterministic, cheap, fast fix rather than asking the LLM to regenerate. Ideal when reliability and cost-efficiency matter more than semantic understanding of the JSON content.

## Known failure modes

- Input JSON is so severely malformed or truncated that deterministic repair is not possible, returning an error
- Input string is empty or whitespace-only (minLength violation)
- JSON structure is ambiguous beyond repair (e.g. deeply nested truncation with no recoverable schema)
- Network timeout or service unavailability returns a non-200 response
- Payment failure via x402 protocol blocks the request

## 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://agentdiet.dev/v1/malformed-json-healer)

## Output

A repaired, syntactically valid JSON object with all formatting issues resolved — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncations patched — ready for programmatic parsing downstream.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "raw_json"
 ],
 "properties": {
  "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/agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-f54a1614/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentdiet.dev](https://www.zero.xyz/host/agentdiet.dev/llms.txt)
