# JSON Schema Repair & Validation for Agent Outputs

> JSON Schema Repair & Validation for Agent Outputs is a paid API for AI agents from agent.kihustle.tech, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Deterministically repairs malformed JSON from agent tool outputs and optionally validates the result against a provided JSON Schema.

## Facts

- Endpoint: POST https://agent.kihustle.tech/services/json-schema-repair/jobs
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-schema-repair-validation-for-agent-outputs-188202e5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zo5Dm9_YdTllR3YRBxQt8

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 json-schema-repair-validation-for-agent-outputs-188202e5 -d '<json body>'
```

Example prompt: The tool call just returned garbled JSON with a missing closing brace — can you run it through the JSON repair service to fix it, and validate the result against this schema: {"type":"object","properties":{"name":{"type":"string"},"score":{"type":"number"}},"required":["name","score"]}?

## When to prefer this

Use this endpoint when you need deterministic, rule-based JSON repair rather than LLM-based reformatting — ideal for tight agent loops where predictability and low cost ($0.01/call) matter more than creative inference. Prefer it over prompt-based JSON fixing when you need auditability, schema enforcement, or when running at scale in automated pipelines.

## Known failure modes

- Input JSON is too severely corrupted to deterministically repair — returns error with explanation
- Provided JSON Schema is itself invalid — returns schema parse error
- Repaired JSON fails schema validation — returns repaired JSON plus validation failure details
- Empty or null input — returns 400-level error
- Input exceeds size limits — returns size limit error

## How this service works

Deterministic JSON repair for agent tool outputs, with optional JSON Schema validation. Built for tight agent loops at micropayment prices.

## Output

Returns a repaired, valid JSON object along with metadata about what was fixed. If a JSON Schema was provided, also returns validation results indicating whether the repaired output conforms to the schema, plus any remaining validation errors.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "schema": {
   "type": "object",
   "description": "Optional JSON Schema"
  },
  "json_text": {
   "type": "string",
   "description": "Raw JSON text to repair"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "job_id": "job_example",
  "status": "completed",
  "service": "json-schema-repair",
  "sources": [
   {
    "url": "inline://json_text",
    "note": "client payload"
   }
  ],
  "summary": "JSON repair succeeded; repaired=True; schema_check=True. Deterministic repair for agent loops.",
  "parse_ok": true,
  "repaired": true,
  "next_jobs": [],
  "schema_ok": true,
  "issue_codes": [],
  "limitations": [
   "Heuristic repair only."
  ],
  "generated_at": "2026-01-01T00:00:00+00:00",
  "repair_notes": [
   "repair_attempted"
  ],
  "repaired_json": {
   "ok": true
  },
  "schema_errors": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-schema-repair-validation-for-agent-outputs-188202e5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent.kihustle.tech](https://www.zero.xyz/host/agent.kihustle.tech/llms.txt)
