# Deterministic A2A Broken-JSON Repair & Schema Validator

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

Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) so multi-agent pipelines can reliably parse structured outputs.

## Facts

- Endpoint: POST https://domain-osint.agentdiet.dev/v1/structured-output?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-11-18
- Activations on Zero: 0
- Provider: domain-osint.agentdiet.dev
- Website: https://domain-osint.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/domain-osint-agentdiet-dev-deterministic-a2a-broken-json-repair-97fec450
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_H7-8khDehwm0scN_0CA3V

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 domain-osint-agentdiet-dev-deterministic-a2a-broken-json-repair-97fec450 -d '<json body>'
```

Example prompt: This JSON output from the LLM is broken — it has trailing commas and markdown fences wrapping it. Can you repair it so it parses cleanly? Here's the raw string: ```json {"name": "Alice", "score": 42, } ```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives malformed, truncated, or markdown-wrapped JSON from an LLM and needs deterministic repair without hallucination. Prefer this over prompt-based repair (asking the LLM to fix it) when you need guaranteed idempotency, low latency, and no additional token cost from re-prompting. Ideal for agentic workflows where structured output reliability is critical and retrying the LLM is expensive or impractical.

## Known failure modes

- Input is too severely malformed to deterministically repair — returns error with description
- Input string is empty or missing raw_json field — returns 400 validation error
- JSON structure is ambiguous after truncation — may return best-effort partial repair
- Payment not received or x402 auth fails — returns 402 Payment Required
- Service timeout on very large malformed inputs

## 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://domain-osint.agentdiet.dev/v1/structured-output)

## Output

Returns a repaired, valid JSON object reconstructed from the malformed input. The response contains the fixed JSON structure with syntax errors corrected, markdown fences removed, trailing commas stripped, and single quotes normalized to double quotes — ready for downstream parsing by agents or 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/domain-osint-agentdiet-dev-deterministic-a2a-broken-json-repair-97fec450/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from domain-osint.agentdiet.dev](https://www.zero.xyz/host/domain-osint.agentdiet.dev/llms.txt)
