# Deterministic A2A Broken-JSON Repair & Schema Validator

> Deterministic A2A Broken-JSON Repair & Schema Validator is a paid API for AI agents from prompt-guard.agentdiet.dev, paid per call via MPP, $0.002/call, status unknown (last checked 2026-10-21).

Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) and validates it against a schema so multi-agent pipelines never crash on bad output.

## Facts

- Endpoint: GET https://prompt-guard.agentdiet.dev/v1/schema-repair?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: prompt-guard.agentdiet.dev
- Website: https://prompt-guard.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-bdd48fee
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KifqKL045Hub2yaHU2u9s

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 prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-bdd48fee
```

Example prompt: This JSON string from my LLM output is broken — it has trailing commas and markdown code fences wrapping it — can you repair it and give me back valid JSON? Here it is: ```{"name": "Alice", "age": 30,}```

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair for LLM outputs rather than heuristic or model-based correction. It is ideal for multi-agent pipelines where broken JSON from upstream language models (trailing commas, markdown fences, single quotes, truncation) would otherwise crash downstream processing. Prefer it over manual parsing logic when you need a reliable, cheap ($0.002/call) programmatic fix with schema validation built in.

## Known failure modes

- Input JSON too severely truncated or corrupted to infer structure — returns error indicating unrecoverable input
- Empty or whitespace-only raw_json input — returns validation error
- Non-JSON input that cannot be interpreted as JSON even with repairs — returns parse failure
- Network timeout or service unavailability — returns 5xx error
- Payment not provided or insufficient — returns HTTP 402 requiring x402 USDC micropayment

## 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://prompt-guard.agentdiet.dev/v1/schema-repair)

## Output

A repaired, well-formed JSON object that was deterministically fixed from the provided malformed input. The response includes the corrected JSON payload that can be safely parsed and used 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/prompt-guard-agentdiet-dev-deterministic-a2a-broken-json-repair-bdd48fee/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from prompt-guard.agentdiet.dev](https://www.zero.xyz/host/prompt-guard.agentdiet.dev/llms.txt)
