# 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 JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash.

## Facts

- Endpoint: GET https://prompt-guard.agentdiet.dev/v1/json-normalizer?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-0e28f468
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sS_Z2P0y4wURq8qa6YT5b

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-0e28f468
```

Example prompt: Can you fix this broken JSON from the last LLM call — it has trailing commas and markdown code fences wrapping it, and my pipeline is crashing on it: ```json {"name": "Alice", "score": 42,} ```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives raw LLM-generated JSON that may contain markdown fences, trailing commas, single quotes, or truncation artifacts and you need a deterministic, low-latency fix before passing data downstream. It is especially valuable in agentic workflows where LLM output is unpredictable and pipeline stability is critical. Prefer it over writing custom regex-based fixups or retrying the LLM, as it provides consistent repair logic without additional token costs.

## Known failure modes

- Input JSON too severely truncated to infer structure — may return partial or best-effort repair
- Ambiguous structure where multiple valid completions exist — repair may not match original intent
- Very large payloads may exceed query parameter length limits since input is passed via GET query string
- Non-JSON input that is fundamentally not JSON-like may return an error or empty result

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

## Output

A repaired, valid JSON object reconstructed from the malformed input. The response contains the cleaned, schema-compliant JSON that can be safely parsed and passed to downstream pipeline steps without crashing.

## 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-0e28f468/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)
