# Deterministic A2A Broken-JSON Repair & Schema Validator

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

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

## Facts

- Endpoint: GET https://workflows.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: workflows.agentdiet.dev
- Website: https://workflows.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/workflows-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-7a92c983
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sSfimHoh4djOOP4CpMUdX

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 workflows-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-7a92c983
```

Example prompt: This JSON string from the LLM has trailing commas and markdown code fences and won't parse — can you repair it so I get back valid, clean JSON? Here it is: ```json {"name": "Alice", "age": 30,} ```

## When to prefer this

Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard parsing due to common syntax issues like trailing commas, markdown code fences, or single quotes. It is particularly valuable as a deterministic middleware layer between LLM output and downstream structured data consumers, where unpredictable formatting would otherwise cause pipeline crashes. Prefer this over writing custom regex fixers or prompting the LLM to retry, as it provides fast, consistent repair without additional token cost.

## Known failure modes

- JSON is too severely malformed to deterministically repair — returns error indicating unrecoverable input
- Input string is empty — rejected by minLength:1 schema validation
- JSON structure is ambiguous after truncation — repair may produce semantically incorrect but syntactically valid output
- Network timeout or service unavailability returns HTTP error
- Extremely large JSON strings may hit query parameter length limits due to GET method

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

## Output

A repaired, valid JSON object with syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed — ready for safe parsing by downstream agents or applications.

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