# JSON Formatter

> JSON Formatter is a paid API for AI agents from agent-data-tools.revmesh2074.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-28).

Formats and pretty-prints a JSON string with configurable indentation and optional key sorting

## Facts

- Endpoint: GET https://agent-data-tools.revmesh2074.workers.dev/json/format?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-28
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-formatter-c6444bbb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zV5AdktywfnIuQ66TdivJ

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-formatter-c6444bbb
```

Example prompt: Can you pretty-print this JSON for me with 4-space indentation and sort the keys alphabetically: {"z":3,"a":1,"m":2}?

## When to prefer this

Use this endpoint when you need a simple, cheap ($0.001), stateless JSON formatting operation with no API key or account required — ideal for agents that need to normalize, prettify, or sort JSON on the fly as a utility step in a larger workflow.

## Known failure modes

- Invalid JSON input returns an error rather than a formatted result
- Missing required 'text' query parameter causes a validation error
- Malformed indentation parameter value may fall back to default behavior

## How this service works

Format JSON with indentation (2 or 4 spaces, or tabs) and optionally sorted keys. Returns the formatted text. Use to make machine JSON readable or to normalise it for diffs.

## Output

Returns a single 'formatted' field containing the input JSON string reformatted as pretty-printed text with the requested indentation style (2 spaces by default, 4 spaces, or tabs) and optionally with object keys sorted alphabetically.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "text"
 ],
 "properties": {
  "text": {
   "type": "string",
   "description": "The JSON text"
  },
  "indent": {
   "type": "string",
   "description": "2 (default), 4 or tab"
  },
  "sortKeys": {
   "type": "string",
   "description": "true to sort object keys"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "formatted": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-formatter-c6444bbb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-data-tools.revmesh2074.workers.dev](https://www.zero.xyz/host/agent-data-tools.revmesh2074.workers.dev/llms.txt)
