Check caller-declared rules across fields of a JSON record: end after start, conditional required, exactly one of
Evaluates up to 100 rules you declare over one JSON document and reports, per rule, pass, fail or unknown with the JSON pointer of every violating field and the actual value class (absent, null, empty string, value). Rule kinds: compare (>, >=, <, <=, ==, != on numbers, exact decimals, RFC 3339 dates or date-times, strings), required-if, forbidden-if, exactly-one, at-most-one, at-least-one, all-or-none, sum-equals (exact decimal sum with tolerance). A * path segment applies the rule to every array element (/lines/*/end > /lines/*/start). Presence is explicit (defined, non-null, non-empty) so absent, null and empty are never conflated. A missing operand yields unknown unless you choose fail or skip. For agents validating tool arguments or records beyond what a per-field schema can say. Rules are data, not code: no expressions are evaluated.
What you get
Per-field schemas cannot say end > start or one-of-three. 100 rules per $0.005 call, exact decimals and strict date parsing.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/cross-field-rules. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/cross-field-rules \
-H 'content-type: application/json' \
-d '{"data":{"start":"2026-03-01","end":"2026-02-01","kind":"card","card":"4111","iban":null},"rules":[{"id":"end-after-start","kind":"compare","left":"/end","op":">","right":"/start","as":"date"},{"id":"card-needs-number","kind":"required-if","when":{"path":"/kind","op":"equals","value":"card"},"require":["/card"]},{"id":"one-payment-method","kind":"exactly-one","fields":["/card","/iban"]}]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
data | any | yes | The JSON document the rules apply to. |
rules | array<object>; max 100 items | yes | |
onMissing | string; one of "unknown", "fail", "skip" | no | Missing or null compare operand: unknown (default), fail or skip. |
Example request body
{
"data": {
"start": "2026-03-01",
"end": "2026-02-01",
"kind": "card",
"card": "4111",
"iban": null
},
"rules": [
{
"id": "end-after-start",
"kind": "compare",
"left": "/end",
"op": ">",
"right": "/start",
"as": "date"
},
{
"id": "card-needs-number",
"kind": "required-if",
"when": {
"path": "/kind",
"op": "equals",
"value": "card"
},
"require": [
"/card"
]
},
{
"id": "one-payment-method",
"kind": "exactly-one",
"fields": [
"/card",
"/iban"
]
}
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
rules | array<object> | no | |
counts | object | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the data-contract-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent