# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from shopify-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, code fences) into valid, parseable JSON for use in multi-agent pipelines.

## Facts

- Endpoint: GET https://shopify-intel.agentdiet.dev/v1/malformed-json-healer?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: shopify-intel.agentdiet.dev
- Website: https://shopify-intel.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/shopify-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-2c502704
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oRhpUBRntiALB0-YdTsvI

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 shopify-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-2c502704
```

Example prompt: This LLM response came back with broken JSON — trailing commas, single quotes, and markdown fences — can you run it through the JSON healer and give me back a clean, parseable object? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair (not AI guessing) in a multi-agent or LLM pipeline where broken JSON from model outputs — trailing commas, single quotes, markdown fences, or truncations — is causing downstream parse failures. Prefer this over writing custom regex sanitization or calling a general-purpose LLM to fix JSON, as it is fast, low-cost ($0.002/call), and guaranteed to apply consistent repair rules without hallucinating new content.

## Known failure modes

- Input JSON is so severely truncated or corrupted that deterministic repair is impossible — may return an error or best-effort partial result
- Input string is not JSON at all (e.g. plain text or binary) — returns a validation error
- Ambiguous structure where multiple valid repairs exist — endpoint picks one deterministically, which may not match original intent
- Empty or whitespace-only input — returns a validation error for missing required field

## 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://shopify-intel.agentdiet.dev/v1/malformed-json-healer)

## Output

A repaired, valid JSON object or string with all syntax errors resolved — trailing commas removed, single quotes replaced with double quotes, markdown fences stripped, and truncations recovered where possible — ready to be parsed and used downstream in an agent pipeline.

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