# 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 truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash

## Facts

- Endpoint: GET https://token-intel.agentdiet.dev/v1/json-fix?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-1adf4a06
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_q_90ZQQvwqHF995jXnagi

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-1adf4a06
```

Example prompt: The LLM just returned this broken JSON with trailing commas and markdown fences — can you fix it so I can parse it: ```{"name": "Alice", "age": 30,}```?

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse() due to common model errors like trailing commas, markdown code fences, single quotes, or truncation. Prefer this over writing custom regex fixers or prompt-engineering the model to output clean JSON — it provides deterministic, rule-based repair rather than probabilistic re-generation. Ideal for production agent pipelines where reliability matters more than round-tripping to the LLM.

## Known failure modes

- JSON too severely malformed to deterministically repair — returns error indicating unrecoverable input
- Empty or missing raw_json parameter — returns 400 validation error
- Input is already valid JSON — may return as-is or confirm validity
- Extremely long 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://token-intel.agentdiet.dev/v1/json-fix)

## Output

Returns a repaired, valid JSON object with malformed syntax corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for direct parsing by downstream agents or applications.

## 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-1adf4a06/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)
