# Foundry JSON Validator and Formatter

> Foundry JSON Validator and Formatter is a paid API for AI agents from minty-sprout.onrender.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-01).

Validates JSON text, reports the error line and column on failure, and returns pretty-printed and minified forms on success.

## Facts

- Endpoint: POST https://minty-sprout.onrender.com/v1/json-format?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/foundry-json-validator-and-formatter-0c9c3b13
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CGZi8L7Mo97Ybz1r6YEeO

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 foundry-json-validator-and-formatter-0c9c3b13 -d '<json body>'
```

Example prompt: Can you check if this JSON is valid and give me both a nicely indented version and a minified one: {"a":1,"b":[1,2]}?

## When to prefer this

Choose this endpoint when you need to both validate AND format JSON in a single call, especially when you want to know the exact line/column of a syntax error. It's ideal for developer tooling, debugging API payloads, or preparing JSON for display vs. transmission. Prefer it over generic text processors when the input is specifically JSON and you need pretty-printed or minified output alongside validity status.

## Known failure modes

- Input exceeds 8000 character limit — request rejected
- Input is not JSON at all (e.g. plain text) — returns valid=false with error position
- Malformed but partially valid JSON — returns line/column of first syntax error
- Empty input — likely returns valid=false
- Network or service unavailability on Render.com free tier — connection timeout or 502 error
- Payment failure via x402 protocol — 402 response, endpoint not invoked

## How this service works

JSON validator and formatter: checks JSON, reports the error line and column, returns pretty and minified forms. Input: JSON text.

## Output

Returns a JSON object with: a 'valid' boolean, the structural 'type' (object/array/etc.), count of top-level 'keys', a 'pretty' pretty-printed string with 2-space indentation, and a 'minified' compact string. On invalid JSON, reports the error line and column instead.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "string",
   "maxLength": 8000,
   "description": "JSON text"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "keys": 2,
  "type": "object",
  "valid": true,
  "pretty": "{\n  \"a\": 1,\n  \"b\": [\n    1,\n    2\n  ]\n}",
  "minified": "{\"a\":1,\"b\":[1,2]}"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/foundry-json-validator-and-formatter-0c9c3b13/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from minty-sprout.onrender.com](https://www.zero.xyz/host/minty-sprout.onrender.com/llms.txt)
