# 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, truncation) so multi-agent pipelines never crash on bad JSON.

## Facts

- Endpoint: POST https://agentdiet.dev/v1/llm-json-schema-healer?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-72998cc9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cvhF7K5SDfZRFLoiiDVQ9

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

Example prompt: This JSON came back from the LLM with trailing commas, single quotes, and a markdown code fence wrapper — can you clean it up and give me valid parseable JSON? Here it is: ```json {'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives raw LLM outputs that may contain trailing commas, markdown code fences, single quotes instead of double quotes, or truncation artifacts, and you need a deterministic (not probabilistic) fix before passing JSON downstream. Prefer this over writing custom regex or using LLM re-prompting for JSON cleanup, as it is purpose-built, cheap per call, and idempotent.

## Known failure modes

- Input is so severely truncated or corrupted that deterministic repair is impossible — returns error indicating irrecoverable JSON
- Input string is empty or below minimum length — validation error on raw_json field
- Input is valid JSON already — may return it unchanged or signal no repair was needed
- Extremely large 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://agentdiet.dev/v1/llm-json-schema-healer)

## Output

Returns a repaired, schema-compliant JSON object. The response contains the cleaned and validated JSON that was reconstructed from the malformed input, ready for downstream parsing without errors.

## 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-72998cc9/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)
