# WritersLogic Cross-Field Rules Validator

> WritersLogic Cross-Field Rules Validator is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Evaluates up to 100 declarative cross-field rules over a JSON document and reports pass, fail, or unknown per rule with violating field pointers and value classes

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/cross-field-rules?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-cross-field-rules-validator-1df04f7d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mAJiyIPmOgqDYy7H4cqEC

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 writerslogic-cross-field-rules-validator-1df04f7d -d '<json body>'
```

Example prompt: Check these invoice records against my cross-field rules: require that 'due_date' is after 'issue_date', that 'subtotal' plus 'tax' equals 'total' within 0.01, and that if 'discount_code' is present then 'discount_amount' must also be present — report which rules pass, fail, or are unknown and show me any violating field paths.

## When to prefer this

Use this endpoint when you need to enforce cross-field business logic that goes beyond per-field JSON Schema validation — such as conditional presence, mutual exclusion, numeric ordering across fields, exact decimal sums, or date ordering on array elements. It is especially well-suited for AI agents validating structured tool arguments or records where rules need to be declared as data rather than code, and where you need precise, non-conflated reporting of absent vs null vs empty field states.

## Known failure modes

- Exceeding 100 rules returns a validation error
- Malformed JSON Pointer syntax in left/right/fields causes rule to error
- sum-equals with non-numeric field values fails to compute
- A wildcard (*) path on a non-array field yields unknown or empty results
- Missing 'kind' or 'id' on any rule object causes request rejection
- Requesting 'decimal' comparison on non-decimal-representable values may yield unknown
- onMissing not set defaults to unknown which may be unexpected for strict validation flows

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

A per-rule evaluation report listing each rule's ID and outcome (pass, fail, or unknown), along with the JSON Pointer of every violating field and the value class of the offending operand (absent, null, empty string, or value). Rules involving array wildcards report results per array element. Missing operands are reported as unknown, fail, or skipped depending on the onMissing setting.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "description": "The JSON document the rules apply to."
  },
  "rules": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "kind"
    ],
    "properties": {
     "as": {
      "enum": [
       "auto",
       "number",
       "decimal",
       "date",
       "datetime",
       "string"
      ],
      "type": "string"
     },
     "id": {
      "type": "string",
      "maxLength": 80
     },
     "op": {
      "enum": [
       "==",
       "!=",
       ">",
       ">=",
       "<",
       "<="
      ],
      "type": "string"
     },
     "kind": {
      "enum": [
       "compare",
       "required-if",
       "forbidden-if",
       "exactly-one",
       "at-most-one",
       "at-least-one",
       "all-or-none",
       "sum-equals"
      ],
      "type": "string"
     },
     "left": {
      "type": "string",
      "maxLength": 300,
      "description": "JSON pointer; * matches every array element."
     },
     "when": {
      "type": "object",
      "required": [
       "path",
       "op"
      ],
      "properties": {
       "op": {
        "enum": [
         "equals",
         "not-equals",
         "in",
         "not-in",
         "present",
         "absent",
         "empty"
        ],
        "type": "string"
       },
       "path": {
        "type": "string",
        "maxLength": 300
       },
       "value": {
        "description": "Operand for equals, not-equals, in, not-in."
       }
      },
      "additionalProperties": false
     },
     "right": {
      "type": "string",
      "maxLength": 300,
      "description": "JSON pointer compared with left (use value for a constant)."
     },
     "total": {
      "type": "string",
      "maxLength": 300
     },
     "value": {
      "description": "Constant to compare with, or the expected total."
     },
     "fields": {
      "type": "array",
      "items": {
       "type": "string",
       "maxLength": 300
      },
      "maxItems": 50
     },
     "forbid": {
      "type": "array",
      "items": {
       "type": "string",
       "maxLength": 300
      },
      "maxItems": 20
     },
     "require": {
      "type": "array",
      "items": {
       "type": "string",
       "maxLength": 300
      },
      "maxItems": 20
     },
     "presence": {
      "enum": [
       "defined",
       "non-null",
       "non-empty"
      ],
      "type": "string",
      "description": "What counts as present: defined 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-cross-field-rules-validator-1df04f7d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
