SchemaCheck Agent
A machine-native paid API for validating JSON payloads against JSON Schema.
Live endpoint: https://projectx402-production.up.railway.app
MCP endpoint: https://projectx402-production.up.railway.app/mcp
What it does
Send a JSON Schema and a JSON payload. Get back a structured validation result: whether the payload is valid, a list of errors with JSONPath locations, a plain-English summary, and optionally a suggested corrected payload.
Built for autonomous agents, backend pipelines, and developers who need reliable, cheap, per-call JSON validation without managing a library dependency.
Supports two access modes:
- MCP tools via Streamable HTTP — connect any MCP-compatible client directly, fiat billing via MCP-Hive
- REST + x402 — HTTP endpoint with USDC micropayment on Base mainnet ($0.005/call)
Endpoints
| Endpoint | Payment | Repair | Limit |
|---|---|---|---|
/mcp (MCP Streamable HTTP) | Fiat via MCP-Hive | Yes (validate_schema) | None |
POST /v1/schema-check | x402 USDC ($0.005) | Yes | None |
POST /v1/schema-check/trial | Free | No | 32KB request body |
GET /health | Free | — | — |
Quickstart — MCP (recommended for AI agents)
Add to your MCP client config:
{
"mcpServers": {
"schemacheck": {
"url": "https://projectx402-production.up.railway.app/mcp"
}
}
}
Two tools are available: validate_schema (full, with repair) and validate_schema_trial (free, no repair). See docs/agent_quickstart.md for a full Python MCP client example.
Quickstart — trial (no payment)
curl -X POST https://projectx402-production.up.railway.app/v1/schema-check/trial \
-H "Content-Type: application/json" \
-d '{
"json_schema": {
"type": "object",
"required": ["name", "email"],
"properties": {
"name": {"type": "string"},
"email": {"type": "string", "format": "email"}
},
"additionalProperties": false
},
"payload": {
"name": "Ada Lovelace",
"email": "not-an-email"
}
}'
Response:
{
"valid": false,
"errors": [
{
"path": "/email",
"code": "format",
"message": "'not-an-email' is not a valid email address.",
"schema_path": "/properties/email/format"
}
],
"summary": "The payload failed validation. 1 error found.",
"suggested_payload": null,
"confidence": 0.9,
"meta": {
"strictness": "normal",
"repair_attempted": false,
"engine": "jsonschema",
"schema_draft": "auto"
}
}
Quickstart — paid endpoint (x402)
The paid endpoint requires an x402 v2 USDC micropayment of $0.005 per call on Base mainnet.
Payment flow:
- Send request to
POST /v1/schema-checkwithout payment headers. - Receive
402 Payment Requiredwithx402Version=2and payment details. - Sign and send payment via
PAYMENT-SIGNATUREheader. - Receive
200with validation result.
See docs/agent_quickstart.md for a full Python example with x402 payment handling.
Request fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
json_schema | object | yes | — | JSON Schema document |
payload | any | yes | — | The JSON value to validate |
strictness | string | no | "normal" | "strict", "normal", or "lenient" |
repair | boolean | no | false | Return a suggested corrected payload if possible |
explain | boolean | no | true | Include plain-English summary |
Response fields
| Field | Type | Description |
|---|---|---|
valid | boolean | true if payload passes schema validation |
errors | array | Structured validation errors; empty when valid |
summary | string | Plain-English summary (null if explain=false) |
suggested_payload | any / null | Corrected payload suggestion (paid endpoint + repair=true only) |
confidence | float | Confidence score 0–1 |
meta | object | Engine, strictness, and repair metadata |
Error codes
required · type · format · enum · additionalProperties · minimum · maximum · minLength · maxLength · pattern · items · oneOf · anyOf · allOf · unknown
Pricing
| Mode | Price |
|---|---|
Trial (/v1/schema-check/trial) | Free |
Paid (/v1/schema-check) | $0.005 USDC per call |
Payment is handled via the x402 protocol — an HTTP-native micropayment standard using USDC on Base.
Health check
curl https://projectx402-production.up.railway.app/health
{"status": "ok", "service": "schemacheck-agent", "version": "0.3.0"}
Reporting issues
If you encounter unexpected responses, payment errors, or validation bugs, please open a GitHub issue.
Include:
- The endpoint called (
/v1/schema-checkor/v1/schema-check/trial) - The request body (redact any sensitive data)
- The response received
- The
X-Request-IDheader value from the response if available
Further reading
- docs/agent_quickstart.md — Full integration guide: MCP tools, x402 payment, trial endpoint
- api_contract.md — Full API contract and error shape reference
- docs/x402_real_flow.md — x402 v2 payment flow details
服务器配置
{
"mcpServers": {
"schemacheck-agent": {
"url": "https://projectx402-production.up.railway.app/sse"
}
}
}