# Deterministic A2A Broken-JSON Repair & Schema Validator

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

Repairs malformed, truncated, or markdown-wrapped JSON outputs from LLMs so multi-agent pipelines can process them without crashing.

## Facts

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

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 company-enrich-agentdiet-dev-deterministic-a2a-broken-json-repair-fda7850e
```

Example prompt: My LLM just returned this JSON with trailing commas and markdown fences around it — can you repair it so it parses correctly: ```{"name": "Acme", "revenue": 500000,}```?

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that is syntactically broken (trailing commas, markdown wrappers, single quotes, truncation) and you need a fast, deterministic fix before passing data to the next agent or tool. It is ideal for automated pipelines where manual intervention is not feasible and reliability is critical. Prefer it over ad-hoc regex fixes or LLM-based re-prompting when you need a consistent, low-latency, rule-based repair.

## Known failure modes

- JSON too severely malformed to deterministically repair — returns an error indicating the string cannot be salvaged
- Empty or whitespace-only input — returns a validation error for missing raw_json
- Non-JSON content passed (e.g. plain text or XML) — may return an error or unexpected output
- Extremely long truncated strings where the intended structure is ambiguous — repair may be incorrect

## 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://company-enrich.agentdiet.dev/v1/json-validator)

## Output

Returns a repaired, valid JSON object with the syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready to be parsed by downstream pipeline steps.

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