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

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

## Facts

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

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

Example prompt: This JSON string from the LLM output has trailing commas and markdown code fences and is crashing my pipeline — can you repair it and give me back a clean, valid JSON object? Here's the raw string: ```json {"name": "Alice", "score": 42, } ```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives JSON from an LLM or external agent that is malformed, truncated, or wrapped in markdown, and you need a deterministic (non-AI) fix rather than another LLM pass. Ideal for production pipelines where reliability and cost predictability matter — at $0.002/call it is cheaper than re-invoking an LLM. Prefer this over manual parsing or regex hacks when you encounter trailing commas, single quotes, or markdown fences consistently in LLM outputs.

## Known failure modes

- Input JSON is so severely malformed it cannot be deterministically repaired — returns error indicating unrecoverable input
- Empty or missing raw_json field — returns 400 validation error
- Input exceeds maximum payload size limits — returns size-related error
- Payment not completed via x402 — returns HTTP 402 with payment required details

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

## Output

A repaired, valid JSON object returned as a structured response. The endpoint deterministically corrects common LLM output defects including trailing commas, markdown code fences, single-quoted keys/values, and truncation issues, returning a clean, parseable JSON payload.

## 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-1dd084d3/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)
