77trust / 100

Json Validate

by toolbelt402.tpoborne.workers.dev in Email & messaging

x402 APIPassing, checked 3 h ago

Validate JSON data against a JSON Schema (draft-07, 2019-09, 2020-12) — returns exact error locations, keywords, and messages for programmatic handling. Deterministic schema validation.

POST https://toolbelt402.tpoborne.workers.dev/json/validate

Last 30 days

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

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://toolbelt402.tpoborne.workers.dev/json/validate" \
  -H "content-type: application/json" \
  -d '{"data":{"age":3},"schema":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"}}'
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%2Ftoolbelt402.tpoborne.workers.dev%2Fjson%2Fvalidate
const res = await pay("https://toolbelt402.tpoborne.workers.dev/json/validate", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"data":{"age":3},"schema":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"}}),
});
console.log(await res.json());

Example input

{
  "data": {
    "age": 3
  },
  "schema": {
    "properties": {
      "name": {
        "type": "string"
      }
    },
    "required": [
      "name"
    ],
    "type": "object"
  }
}

Example output

{
  "errors": [
    {
      "error": "Instance does not have required property \"name\".",
      "keyword": "required",
      "location": "#"
    }
  ],
  "valid": false
}

Security scan

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

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402605 ms$0.002
7 h agoPassed402553 ms$0.002
11 h agoPassed402627 ms$0.002
15 h agoPassed402755 ms$0.002
18 h agoPassed402625 ms$0.002
22 h agoPassed402446 ms$0.002
25 h agoPassed402610 ms$0.002
29 h agoPassed402766 ms$0.002
33 h agoPassed4021.0 s$0.002
36 h agoPassed402774 ms$0.002
40 h agoPassed402513 ms$0.002
44 h agoPassed402571 ms$0.002
47 h agoPassed402509 ms$0.002
2 days agoPassed402628 ms$0.002
2 days agoPassed402489 ms$0.002