# Deterministic A2A Broken-JSON Repair & Schema Validator

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

Repairs malformed, truncated, or markdown-wrapped LLM JSON outputs (trailing commas, single quotes, unclosed braces) so multi-agent pipelines never crash on bad JSON.

## Facts

- Endpoint: POST https://hn-pulse.agentdiet.dev/v1/json-validator?utm_source=zero.xyz
- Price: $0.002/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-11-21
- Activations on Zero: 0
- Provider: hn-pulse.agentdiet.dev
- Website: https://hn-pulse.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/hn-pulse-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-17d03a46
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UAgF85pG3HjBoMxjSMMKj

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 hn-pulse-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-17d03a46 -d '<json body>'
```

Example prompt: This JSON from our LLM has trailing commas and is wrapped in markdown fences — can you repair it so we can parse it without crashing? Here's the raw string: ```json {"name": "Alice", "age": 30,} ```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that is syntactically broken and must be repaired deterministically (not re-generated) before passing to a downstream consumer. Ideal when you need idempotent, reproducible repairs rather than asking the LLM to retry, or when the truncated output cannot be regenerated cheaply. Prefer over regex hacks when handling a variety of common LLM JSON failure modes simultaneously.

## Known failure modes

- Input JSON is so severely malformed that deterministic repair is impossible — returns an error indicating the string cannot be recovered
- Empty or whitespace-only raw_json input rejected with validation error
- Input exceeds maximum allowed string length
- Payment not attached or insufficient for x402 micropayment — returns HTTP 402

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

## Output

Returns a JSON object containing the repaired, syntactically valid JSON — with markdown fences stripped, trailing commas removed, single quotes converted to double quotes, and truncated structures closed — ready for safe programmatic parsing downstream.

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