# Deterministic A2A Broken-JSON Repair & Schema Validator

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

## Facts

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

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 sec-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-01a54acc
```

Example prompt: The LLM just returned this mangled JSON with trailing commas and markdown code fences — can you clean it up and give me a valid, parseable JSON object? Here's the raw string: ```{"name": "Alice", "score": 42, }```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives raw LLM-generated JSON that frequently contains syntax errors like trailing commas, markdown code fences, single-quoted keys, or truncated structures. It is particularly valuable in automated agent workflows where downstream tools require strictly valid JSON and crashing on malformed output is unacceptable. Prefer this over hand-rolled regex fixers when you need deterministic, reliable repair rather than probabilistic heuristics.

## Known failure modes

- Input is so severely malformed it cannot be deterministically repaired — returns error or best-effort partial output
- Input is not JSON at all (e.g. plain text or binary) — may return error indicating unrecognizable format
- Truncation is too extreme to infer intended structure — output may differ from original intent
- Missing required raw_json parameter — returns 400 or validation error
- Payment not completed (HTTP 402) — request blocked until x402 payment is fulfilled

## 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://sec-intel.agentdiet.dev/v1/repair)

## Output

A repaired, valid JSON object reconstructed from the malformed input. The response contains the cleaned JSON with all syntax errors resolved — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing.

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