# x402broker JSON Repair & Schema Validator

> x402broker JSON Repair & Schema Validator is a paid API for AI agents from x402broker.com, paid per call via x402 or MPP, $0.002/call, status unknown (last checked 2026-10-20).

Repairs malformed or truncated LLM JSON output (trailing commas, markdown fences, single quotes) and validates it against a schema so multi-agent pipelines stay crash-free.

## Facts

- Endpoint: GET https://x402broker.com/v1/json-validator?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402, MPP
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402broker-json-repair-schema-validator-5e361f40
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nPUznhg5Jsq1IbyPtFxdV

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 x402broker-json-repair-schema-validator-5e361f40
```

Example prompt: This JSON from my LLM has trailing commas and markdown code fences wrapping it — can you repair it and give me clean, valid JSON I can pass to the next step in my pipeline?

## When to prefer this

Choose this endpoint when your multi-agent or LLM pipeline is receiving JSON that fails to parse due to common LLM formatting quirks like markdown wrapping, trailing commas, or single-quoted keys. It is purpose-built for deterministic, low-latency JSON repair in automated pipelines rather than general-purpose text cleanup or schema generation.

## Known failure modes

- JSON too severely malformed to repair — returns error with description of unrecoverable structure
- Input is not JSON-like at all — returns validation error
- Schema mismatch after repair — returns repaired JSON alongside schema violation details
- Empty or missing raw_json parameter — returns 400 bad request

## 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://x402broker.com/v1/json-validator)

## Output

Returns a repaired, schema-compliant JSON object with malformed syntax corrected — including removal of markdown fences, conversion of single quotes to double quotes, trailing comma removal, and completion of truncated structures. Suitable for direct use in 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/x402broker-json-repair-schema-validator-5e361f40/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402broker.com](https://www.zero.xyz/host/x402broker.com/llms.txt)
