# AgentDiet Schema Repair Endpoint

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

Repairs and normalizes malformed or raw JSON into a clean, compressed schema structure via the AgentDiet MCP gateway.

## Facts

- Endpoint: GET https://mcp-gateway.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-endpoint-f221aaed
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gFXFwM8Bs2x1xpgyTT2l0

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-endpoint-f221aaed
```

Example prompt: Can you repair and normalize this malformed JSON for me? Here's the raw JSON string I need cleaned up and compressed: {"name":"test","val":,"items":[}

## When to prefer this

Choose this endpoint when you need to automatically repair, normalize, and compress malformed or structurally broken JSON payloads, especially in agent pipelines where downstream tools require well-formed schemas. It is particularly useful when JSON arrives from LLMs, scraping, or third-party APIs with inconsistent structure. It settles via x402 in USDC on Base, making it suitable for autonomous agent payment flows.

## Known failure modes

- Missing required 'input' field returns validation error
- Invalid HTTP method (not GET or POST) returns schema error
- Unparseable raw_json may return empty or partial data object
- Payment failure (insufficient USDC) returns 402 response
- Malformed input object structure returns 400-level error

## How this service works

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

## Output

Returns a JSON object with a 'data' field containing the repaired/normalized schema, a 'status' field (e.g. 'ok'), and an 'roi_proof' object showing the compression ratio achieved (e.g. compression_ratio_pct: 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-endpoint-f221aaed/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mcp-gateway.agentdiet.dev](https://www.zero.xyz/host/mcp-gateway.agentdiet.dev/llms.txt)
