# AgentDiet Schema Repair

> AgentDiet Schema Repair is a paid API for AI agents from status.agentdiet.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-22).

Repairs and validates malformed or bloated JSON schemas passed as raw input, returning a cleaned schema with compression metrics

## Facts

- Endpoint: GET https://status.agentdiet.dev/v1/schema-repair?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-schema-repair-ff4f0b2e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TGUpY6I_eMnc6NRNO7tyq

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 agentdiet-schema-repair-ff4f0b2e
```

Example prompt: Can you run this raw JSON through AgentDiet's schema repair to fix any structural issues and tell me the compression ratio it achieves?

## When to prefer this

Choose this endpoint when you need to programmatically repair, validate, or compress a raw JSON schema before passing it into an AI agent context window or MCP pipeline. Especially useful when schema size is causing token budget issues or when downstream agents are rejecting malformed schemas. Prefer over generic JSON linters when you also need compression metrics (roi_proof) and deterministic A2A-compatible output.

## Known failure modes

- Missing required 'input' field returns validation error
- Invalid or unparseable raw_json query param may return empty or error data
- Network or payment failure (x402 USDC settlement) prevents execution
- Malformed HTTP method enum value causes request rejection
- Empty or null raw_json results in no meaningful repair output

## How this service works

Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://status.agentdiet.dev settling in USDC on Base.

## Output

Returns a JSON object with a 'data' field containing the repaired schema, a 'status' field (e.g. 'ok'), and a 'roi_proof' object including 'compression_ratio_pct' indicating how much the schema was compressed (e.g. 91.4%).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "POST"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "raw_json": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {},
  "status": "ok",
  "roi_proof": {
   "compression_ratio_pct": 91.4
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentdiet-schema-repair-ff4f0b2e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from status.agentdiet.dev](https://www.zero.xyz/host/status.agentdiet.dev/llms.txt)
