# AgentTools JSON Formatter & Validator

> AgentTools JSON Formatter & Validator is a paid API for AI agents from agentstoolshub.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-12).

Validates JSON with precise error messages, pretty-prints it with configurable indentation, and returns its top-level type and element count.

## Facts

- Endpoint: GET https://agentstoolshub.com/api/v1/dev/json-formatter?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenttools-json-formatter-validator-434d57af
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lIIOdVTBt7QJIwUwwfk3c

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 agenttools-json-formatter-validator-434d57af
```

Example prompt: Can you validate this JSON and pretty-print it with 2-space indentation? Here it is: {"name":"Alice","age":30,"roles":["admin","user"]}

## When to prefer this

Choose this endpoint when an agent needs to validate JSON correctness with actionable error messages, reformat minified JSON for human or downstream readability, or quickly inspect the structure and size of a JSON value — all in a single call without standing up a local JSON parser.

## Known failure modes

- Invalid or malformed JSON input returns a detailed parse error message with position or context
- Missing required 'json' query parameter results in a 400 error
- Non-JSON string passed as input triggers validation failure with explanation
- Network timeout for very large JSON payloads

## How this service works

Validate JSON with precise error messages, pretty-print it with any indent, and inspect its top-level type and element counts. Use this when an agent needs to validate, pretty-print and inspect JSON.

## Output

Returns whether the JSON is valid or not (with precise error messages if invalid), the pretty-printed version with the requested indentation, the top-level type (object, array, string, number, boolean, null), and the count of top-level elements.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "json"
     ],
     "properties": {
      "json": {
       "type": "string",
       "description": "JSON"
      },
      "indent": {
       "type": "number",
       "description": "Indent spaces"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agenttools-json-formatter-validator-434d57af/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentstoolshub.com](https://www.zero.xyz/host/agentstoolshub.com/llms.txt)
