# 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, markdown fences) so multi-agent pipelines can process valid JSON reliably.

## Facts

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

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-e9720921
```

Example prompt: This JSON string came back from the LLM with trailing commas and markdown fences wrapping it — can you run it through the JSON repair tool and give me back clean, valid JSON? Here's the raw output: ```{"name": "Alice", "score": 95,}```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair rather than probabilistic LLM re-generation. Ideal for multi-agent pipelines where JSON from LLM steps may have predictable syntax issues (trailing commas, markdown fences, single quotes) and you need fast, cheap, reliable sanitization without sending the payload back to a large model. Prefer over custom parsing code when operating in environments where crashing on bad JSON is unacceptable.

## Known failure modes

- Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable input
- Empty or whitespace-only raw_json input — returns validation error
- Input is already valid JSON — may return it unchanged or with a success flag
- Network or payment (x402) failure results in HTTP 402 or 5xx 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://token-intel.agentdiet.dev/v1/json-validator)

## Output

Returns a JSON object containing the repaired, valid JSON string reconstructed from the malformed input, with syntax errors corrected (trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, truncated structures closed).

## 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-e9720921/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)
