# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from mesh.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://mesh.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: mesh.agentdiet.dev
- Website: https://mesh.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-43a0c500
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YVr6Rx9ZnldCaqT2EXC_n

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 mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-43a0c500
```

Example prompt: This JSON string came back from an LLM and it's broken — it has trailing commas, markdown code fences, and single quotes — can you repair it and give me back valid JSON? Here it is: ```json {'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair (not probabilistic LLM-based rewriting) for LLM outputs in automated multi-agent pipelines where reliability and consistency matter. It is ideal when JSON outputs contain common LLM formatting artifacts like markdown fences, trailing commas, or single quotes. Prefer it over ad-hoc string manipulation when you need a robust, pipeline-safe solution that won't introduce new errors.

## Known failure modes

- Input JSON is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable structure
- Empty or whitespace-only raw_json input — validation error on minLength constraint
- Non-JSON input (e.g. plain prose) passed as raw_json — may return error or attempt best-effort repair
- Payment failure via x402 micropayment protocol — 402 response requiring payment before processing

## 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://mesh.agentdiet.dev/v1/json-validator)

## Output

A repaired, well-formed JSON object or string that has had issues such as trailing commas, markdown code fences, single quotes, and truncation corrected, making it safe to parse downstream in agent pipelines

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