# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from company-enrich.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 never crash

## Facts

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

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 company-enrich-agentdiet-dev-deterministic-a2a-broken-json-repair-bc646e36
```

Example prompt: This LLM response came back with broken JSON — it has trailing commas, markdown code fences, and single quotes. Can you fix it so it parses correctly? Here's the raw output: ```json\n{'name': 'Acme Corp', 'revenue': 1000000,}\n```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that frequently contains syntax errors like trailing commas, markdown code fences, single quotes, or truncation — and you need a fast, deterministic (non-LLM) repair that won't introduce hallucinated values or alter the data semantics. Prefer this over prompting the LLM to self-correct (which is slow and non-deterministic) or writing custom regex parsers.

## Known failure modes

- JSON is so severely malformed that deterministic repair is impossible, returning an error
- Input is not JSON at all (e.g. plain text or binary), resulting in a repair failure
- Ambiguous truncation where the intended structure cannot be inferred, leading to incorrect repair
- Empty or whitespace-only input returning a validation error

## 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://company-enrich.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 closed — ready for downstream parsing without crashes

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