# 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-23).

Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash

## Facts

- Endpoint: POST https://agentdiet.dev/v1/json-validator?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-23
- 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-f8b67c0f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6phrKQXzFhmECf3_iriUV

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-f8b67c0f -d '<json body>'
```

Example prompt: The LLM just returned this broken JSON with trailing commas and markdown code fences — can you repair it so my pipeline can parse it: ```json {"name": "Alice", "score": 42,} ```

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline produces JSON that fails standard parsing due to common LLM artifacts like trailing commas, markdown code fences, single-quoted keys, or truncation. Ideal for agent orchestration layers that need a deterministic, automated repair step before passing data downstream, especially when you cannot afford pipeline crashes and need a fast, cheap ($0.002/call) fix rather than re-prompting the LLM.

## Known failure modes

- Input JSON is too severely corrupted to deterministically repair — returns error indicating unrecoverable structure
- Input string is completely empty or not JSON-like at all — returns validation error
- Ambiguous truncation point where multiple valid repairs are possible — may return best-effort result with caveat
- Service returns 402 Payment Required if x402 micropayment is not provided or insufficient

## 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/json-validator)

## Output

A repaired, valid JSON object reconstructed from the malformed or truncated input, with issues like trailing commas, markdown fences, single quotes, and truncation resolved so it can be safely parsed by downstream systems

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