# Deterministic A2A Broken-JSON Repair & Schema Validator

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

Repairs malformed, truncated, or markdown-wrapped JSON strings (trailing commas, single quotes, fences) so multi-agent pipelines can safely parse LLM outputs without crashing.

## Facts

- Endpoint: GET https://token-intel.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: token-intel.agentdiet.dev
- Website: https://token-intel.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-609b3658
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gtZWCAK-4fOQ7I3D5Es5C

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 token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-609b3658
```

Example prompt: The LLM just returned this broken JSON with trailing commas and markdown code fences — can you run it through the JSON healer to get back a clean, parseable object? Here's the raw string: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair (not AI-generated guessing) for LLM pipeline outputs that have predictable syntax issues like trailing commas, markdown fences, or single-quote keys. Prefer it over manual regex fixes when you need a reliable, pay-per-call microservice that integrates into A2A and MCP workflows natively.

## Known failure modes

- Input so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable JSON
- Empty or whitespace-only raw_json parameter — returns validation error
- Input that is not JSON at all (e.g. plain prose) — may return parse failure or best-effort empty object
- Network or upstream service errors — returns HTTP 5xx or timeout

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

## Output

Returns a repaired, valid JSON object derived from the malformed input string, with all syntax errors (trailing commas, markdown fences, single quotes, truncations) corrected so the output is immediately parseable by standard JSON parsers.

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