81trust / 100

Dev Json Formatter

by AgentTools in Onchain & crypto

x402 APIPassing, checked 4 h ago

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.

GET https://agenttools-hub.vercel.app/api/v1/dev/json-formatter

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
139 ms typical, 139 ms slowest 5%
Last check
4 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X GET "https://agenttools-hub.vercel.app/api/v1/dev/json-formatter?indent=2&json=%7B%22name%22%3A%22Ada%22%2C%22langs%22%3A%5B%22ts%22%2C%22py%22%5D%2C%22active%22%3Atrue%7D"
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagenttools-hub.vercel.app%2Fapi%2Fv1%2Fdev%2Fjson-formatter
const res = await pay("https://agenttools-hub.vercel.app/api/v1/dev/json-formatter?indent=2&json=%7B%22name%22%3A%22Ada%22%2C%22langs%22%3A%5B%22ts%22%2C%22py%22%5D%2C%22active%22%3Atrue%7D");
console.log(await res.json());

Example input

{
  "indent": 2,
  "json": "{\"name\":\"Ada\",\"langs\":[\"ts\",\"py\"],\"active\":true}"
}

Example output

{
  "result": {
    "answer": "{\n  \"name\": \"Ada\",\n  \"langs\": [\n    \"ts\",\n    \"py\"\n  ],\n  \"active\": true\n}",
    "answerLabel": "Valid JSON ✓",
    "details": [
      {
        "label": "Top-level type",
        "value": "object"
      },
      {
        "label": "Top-level keys",
        "value": "3"
      },
      {
        "label": "Minified size",
        "value": "48 chars"
      },
      {
        "label": "Formatted size",
        "value": "74 chars"
      }
    ],
    "steps": [
      "JSON.parse validated the syntax",
      "Re-stringified with 2-space indent"
    ],
    "value": null
  },
  "tool": "json-formatter"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
4 h agoPassed402139 ms$0.002