Skip to main content
Glama

Rafid Intelligence Network

invoice_anomaly_check

Read-onlyIdempotent

Detect duplicate, inconsistent, unusual or potentially fraudulent invoices before payment using arithmetic, supplier-history, purchase-order and payment-detail checks. Returns a 0–100 risk score, a risk level, an advisory decision (continue / review / hold) and machine-readable anomalies (e.g. DUPLICATE_INVOICE, POSSIBLE_DUPLICATE, BANK_ACCOUNT_CHANGED, PO_AMOUNT_EXCEEDED, SPLIT_INVOICE_PATTERN, SUBTOTAL_MISMATCH), each with severity, confidence and structured evidence. Works on a single invoice (standalone) or with optional historical invoices, supplier profile, purchase order, contract, approval threshold and payment history (context-aware). Deterministic, decimal-safe, any country and currency. When: Use before approving, paying, booking, reconciling or auditing an invoice, especially when an agent needs to determine whether the invoice requires human review. Selection: primary; prefer for invoice review before payment or duplicate and arithmetic checks. Do not use for company-level due diligence or extracting arbitrary document facts. Input is a strict JSON object; see the schema. Price: $0.25 USD per call. A free preview is available through preview_capability before payment. Full execution is paid per call via x402; an unpaid MCP call returns payment instructions.

Input Schema

NameRequiredDescriptionDefault
invoiceYesThe invoice to check. Only `total` is required. Amounts: number or plain decimal string ("9200.50"); dates: ISO 8601; currency: ISO 4217 code; bankAccount is never echoed unmasked.
optionsNo
contractNoThe governing contract.
purchaseOrderNoThe purchase order the invoice is billed against.
paymentHistoryNoPast payments (any supplier). Used for known payment accounts and already-paid detection.
approvalContextNo
supplierProfileNoSupplier master data for the invoice's supplier.
historicalInvoicesNoPreviously received invoices (any supplier; up to 1000). Enables duplicate, supplier-behavior, payment-detail and split checks.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "anomalies": {
      -        "description": "Most severe first. At most one record per anomaly code; sub-findings are in evidence.issues.",
      -        "items": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "code": {
      -              "description": "Stable machine code of the anomaly type.",
      -              "enum": [
      -                "SUBTOTAL_MISMATCH",
      -                "TAX_MISMATCH",
      -                "TOTAL_MISMATCH",
      -                "LINE_TOTAL_MISMATCH",
      -                "DUPLICATE_INVOICE",
      -                "POSSIBLE_DUPLICATE",
      -                "UNUSUAL_AMOUNT",
      -                "SUPPLIER_PATTERN_DEVIATION",
      -                "UNUSUAL_CURRENCY",
      -                "UNUSUAL_PAYMENT_TERMS",
      -                "INVOICE_NUMBER_ANOMALY",
      -                "BANK_ACCOUNT_CHANGED",
      -                "UNKNOWN_BANK_ACCOUNT",
      -                "PO_MISMATCH",
      -                "PO_AMOUNT_EXCEEDED",
      -                "CONTRACT_LIMIT_EXCEEDED",
      -                "APPROVAL_THRESHOLD_EXCEEDED",
      -                "SPLIT_INVOICE_PATTERN",
      -                "DATE_ANOMALY",
      -                "DUE_DATE_ANOMALY",
      -                "DUPLICATE_LINE_ITEM",
      -                "MISSING_REQUIRED_FIELD"
      -              ],
      -              "type": "string"
      -            },
      -            "confidence": {
      -              "description": "0–1 strength of the supporting evidence (not a probability of fraud).",
      -              "maximum": 1,
      -              "minimum": 0,
      -              "type": "number"
      -            },
      -            "evidence": {
      -              "additionalProperties": {},
      -              "description": "Structured, factual evidence for the finding (matched records, expected vs stated values, baselines, thresholds). Bank accounts appear only masked (****1234).",
      -              "propertyNames": {
      -                "type": "string"
      -              },
      -              "type": "object"
      -            },
      -            "explanation": {
      -              "description": "One factual sentence, phrased as a risk indicator (never an accusation).",
      -              "type": "string"
      -            },
      -            "field": {
      -              "description": "Primary invoice field concerned (e.g. invoiceNumber, bankAccount, total), or null.",
      -              "type": [
      -                "string",
      -                "null"
      -              ]
      -            },
      -            "severity": {
      -              "enum": [
      -                "info",
      -                "low",
      -                "medium",
      -                "high",
      -                "critical"
      -              ],
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "code",
      -            "severity",
      -            "confidence",
      -            "field",
      -            "explanation",
      -            "evidence"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "anomalyCount": {
      -        "maximum": 9007199254740991,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "asOfDate": {
      -        "description": "Reference date (UTC) used for date checks.",
      -        "type": "string"
      -      },
      -      "checkedAt": {
      -        "description": "ISO timestamp of the as-of date (UTC start of day). Deliberately day-granular so identical inputs give identical output; pass options.asOfDate for full reproducibility.",
      -        "type": "string"
      -      },
      -      "contextUsed": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "approvalContext": {
      -            "type": "boolean"
      -          },
      -          "contract": {
      -            "type": "boolean"
      -          },
      -          "historicalInvoices": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "paymentHistory": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "purchaseOrder": {
      -            "type": "boolean"
      -          },
      -          "supplierHistoryMatched": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "supplierProfile": {
      -            "type": "boolean"
      -          }
      -        },
      -        "required": [
      -          "historicalInvoices",
      -          "supplierHistoryMatched",
      -          "paymentHistory",
      -          "supplierProfile",
      -          "purchaseOrder",
      -          "contract",
      -          "approvalContext"
      -        ],
      -        "type": "object"
      -      },
      -      "dataCompleteness": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "missingRecommendedFields": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          },
      -          "missingRequiredFields": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          }
      -        },
      -        "required": [
      -          "missingRequiredFields",
      -          "missingRecommendedFields"
      -        ],
      -        "type": "object"
      -      },
      -      "decision": {
      -        "description": "Advisory only: low → continue, medium/high → review, critical → hold. Not a payment approval or rejection.",
      -        "enum": [
      -          "continue",
      -          "review",
      -          "hold"
      -        ],
      -        "type": "string"
      -      },
      -      "financialChecks": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "computed": {
      -            "additionalProperties": false,
      -            "properties": {
      -              "expectedTax": {
      -                "type": [
      -                  "number",
      -                  "null"
      -                ]
      -              },
      -              "expectedTotal": {
      -                "type": [
      -                  "number",
      -                  "null"
      -                ]
      -              },
      -              "lineItemsSum": {
      -                "type": [
      -                  "number",
      -                  "null"
      -                ]
      -              },
      -              "tolerance": {
      -                "type": "number"
      -              }
      -            },
      -            "required": [
      -              "lineItemsSum",
      -              "expectedTax",
      -              "expectedTotal",
      -              "tolerance"
      -            ],
      -            "type": "object"
      -          },
      -          "lineTotalsValid": {
      -            "description": "quantity × unitPrice − discount ≈ line total for every line that states all three; null when none does.",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          },
      -          "subtotalValid": {
      -            "description": "Σ line totals ≈ subtotal; null when not checkable (no lines or no subtotal).",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          },
      -          "taxValid": {
      -            "description": "Stated tax ≈ tax implied by the stated rate(s); null when no rate or no tax is stated.",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          },
      -          "totalValid": {
      -            "description": "subtotal − discount + tax + shipping ≈ total; null when not checkable.",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          }
      -        },
      -        "required": [
      -          "subtotalValid",
      -          "taxValid",
      -          "totalValid",
      -          "lineTotalsValid",
      -          "computed"
      -        ],
      -        "type": "object"
      -      },
      -      "invoiceSummary": {
      -        "additionalProperties": false,
      -        "description": "Normalized key fields of the checked invoice (bank account masked).",
      -        "properties": {
      -          "bankAccountMasked": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "currency": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "dueDate": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "invoiceDate": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "invoiceNumber": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "lineItemCount": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "supplierId": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "supplierName": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "total": {
      -            "type": "number"
      -          }
      -        },
      -        "required": [
      -          "invoiceNumber",
      -          "supplierName",
      -          "supplierId",
      -          "invoiceDate",
      -          "dueDate",
      -          "currency",
      -          "total",
      -          "lineItemCount",
      -          "bankAccountMasked"
      -        ],
      -        "type": "object"
      -      },
      -      "limitations": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "mode": {
      -        "enum": [
      -          "standalone",
      -          "context_aware"
      -        ],
      -        "type": "string"
      -      },
      -      "recommendedAction": {
      -        "type": "string"
      -      },
      -      "riskLevel": {
      -        "description": "low 0–14, medium 15–39, high 40–64, critical 65–100.",
      -        "enum": [
      -          "low",
      -          "medium",
      -          "high",
      -          "critical"
      -        ],
      -        "type": "string"
      -      },
      -      "riskScore": {
      -        "description": "0–100, higher = more risk indicators; see scoring for the exact computation.",
      -        "maximum": 100,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "scoring": {
      -        "additionalProperties": false,
      -        "description": "Exact score derivation: per-anomaly points = basePoints × confidence, severity-group caps, correlation bonus, severity ceiling.",
      -        "properties": {
      -          "cappedBySeverity": {
      -            "type": "boolean"
      -          },
      -          "components": {
      -            "items": {
      -              "additionalProperties": false,
      -              "properties": {
      -                "basePoints": {
      -                  "type": "number"
      -                },
      -                "code": {
      -                  "type": "string"
      -                },
      -                "confidence": {
      -                  "type": "number"
      -                },
      -                "points": {
      -                  "type": "number"
      -                },
      -                "severity": {
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "code",
      -                "severity",
      -                "confidence",
      -                "basePoints",
      -                "points"
      -              ],
      -              "type": "object"
      -            },
      -            "type": "array"
      -          },
      -          "escalationBonus": {
      -            "type": "number"
      -          },
      -          "escalationReasons": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          },
      -          "highSeverityPoints": {
      -            "type": "number"
      -          },
      -          "levelBands": {
      -            "additionalProperties": false,
      -            "properties": {
      -              "critical": {
      -                "type": "string"
      -              },
      -              "high": {
      -                "type": "string"
      -              },
      -              "low": {
      -                "type": "string"
      -              },
      -              "medium": {
      -                "type": "string"
      -              }
      -            },
      -            "required": [
      -              "low",
      -              "medium",
      -              "high",
      -              "critical"
      -            ],
      -            "type": "object"
      -          },
      -          "lowSeverityPoints": {
      -            "type": "number"
      -          },
      -          "mediumSeverityPoints": {
      -            "type": "number"
      -          },
      -          "model": {
      -            "type": "string"
      -          },
      -          "rawScore": {
      -            "type": "number"
      -          }
      -        },
      -        "required": [
      -          "model",
      -          "components",
      -          "lowSeverityPoints",
      -          "mediumSeverityPoints",
      -          "highSeverityPoints",
      -          "escalationBonus",
      -          "escalationReasons",
      -          "cappedBySeverity",
      -          "rawScore",
      -          "levelBands"
      -        ],
      -        "type": "object"
      -      },
      -      "summary": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "riskScore",
      -      "riskLevel",
      -      "decision",
      -      "anomalyCount",
      -      "anomalies",
      -      "financialChecks",
      -      "recommendedAction",
      -      "summary",
      -      "mode",
      -      "contextUsed",
      -      "invoiceSummary",
      -      "dataCompleteness",
      -      "scoring",
      -      "limitations",
      -      "asOfDate",
      -      "checkedAt"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "nextAction": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "instruction": {
      -            "type": "string"
      -          },
      -          "target": {
      -            "const": "x402_endpoint",
      -            "type": "string"
      -          },
      -          "type": {
      -            "const": "pay_and_retry",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "type",
      -          "target",
      -          "instruction"
      -        ],
      -        "type": "object"
      -      },
      -      "payment": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "endpoint": {
      -            "type": "string"
      -          },
      -          "method": {
      -            "const": "POST",
      -            "type": "string"
      -          },
      -          "retrySameBody": {
      -            "const": true,
      -            "type": "boolean"
      -          }
      -        },
      -        "required": [
      -          "endpoint",
      -          "method",
      -          "retrySameBody"
      -        ],
      -        "type": "object"
      -      },
      -      "preview": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "fullResultAvailable": {
      -            "const": true,
      -            "type": "boolean"
      -          },
      -          "inputAccepted": {
      -            "const": true,
      -            "type": "boolean"
      -          },
      -          "summary": {
      -            "type": "string"
      -          },
      -          "useCases": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          }
      -        },
      -        "required": [
      -          "inputAccepted",
      -          "fullResultAvailable",
      -          "summary",
      -          "useCases"
      -        ],
      -        "type": "object"
      -      },
      -      "price": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "amount": {
      -            "minimum": 0,
      -            "type": "number"
      -          },
      -          "currency": {
      -            "type": "string"
      -          },
      -          "protocol": {
      -            "const": "x402",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "amount",
      -          "currency",
      -          "protocol"
      -        ],
      -        "type": "object"
      -      },
      -      "requestId": {
      -        "type": "string"
      -      },
      -      "status": {
      -        "const": "payment_required",
      -        "type": "string"
      -      },
      -      "tool": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "status",
      -      "tool",
      -      "requestId",
      -      "price",
      -      "preview",
      -      "payment",
      -      "nextAction"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "anomalies": {
      +        "description": "Most severe first. At most one record per anomaly code; sub-findings are in evidence.issues.",
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "code": {
      +              "description": "Stable machine code of the anomaly type.",
      +              "enum": [
      +                "SUBTOTAL_MISMATCH",
      +                "TAX_MISMATCH",
      +                "TOTAL_MISMATCH",
      +                "LINE_TOTAL_MISMATCH",
      +                "DUPLICATE_INVOICE",
      +                "POSSIBLE_DUPLICATE",
      +                "UNUSUAL_AMOUNT",
      +                "SUPPLIER_PATTERN_DEVIATION",
      +                "UNUSUAL_CURRENCY",
      +                "UNUSUAL_PAYMENT_TERMS",
      +                "INVOICE_NUMBER_ANOMALY",
      +                "BANK_ACCOUNT_CHANGED",
      +                "UNKNOWN_BANK_ACCOUNT",
      +                "PO_MISMATCH",
      +                "PO_AMOUNT_EXCEEDED",
      +                "CONTRACT_LIMIT_EXCEEDED",
      +                "APPROVAL_THRESHOLD_EXCEEDED",
      +                "SPLIT_INVOICE_PATTERN",
      +                "DATE_ANOMALY",
      +                "DUE_DATE_ANOMALY",
      +                "DUPLICATE_LINE_ITEM",
      +                "MISSING_REQUIRED_FIELD"
      +              ],
      +              "type": "string"
      +            },
      +            "confidence": {
      +              "description": "0–1 strength of the supporting evidence (not a probability of fraud).",
      +              "maximum": 1,
      +              "minimum": 0,
      +              "type": "number"
      +            },
      +            "evidence": {
      +              "additionalProperties": {},
      +              "description": "Structured, factual evidence for the finding (matched records, expected vs stated values, baselines, thresholds). Bank accounts appear only masked (****1234).",
      +              "propertyNames": {
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "explanation": {
      +              "description": "One factual sentence, phrased as a risk indicator (never an accusation).",
      +              "type": "string"
      +            },
      +            "field": {
      +              "description": "Primary invoice field concerned (e.g. invoiceNumber, bankAccount, total), or null.",
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "severity": {
      +              "enum": [
      +                "info",
      +                "low",
      +                "medium",
      +                "high",
      +                "critical"
      +              ],
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "code",
      +            "severity",
      +            "confidence",
      +            "field",
      +            "explanation",
      +            "evidence"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "anomalyCount": {
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "asOfDate": {
      +        "description": "Reference date (UTC) used for date checks.",
      +        "type": "string"
      +      },
      +      "checkedAt": {
      +        "description": "ISO timestamp of the as-of date (UTC start of day). Deliberately day-granular so identical inputs give identical output; pass options.asOfDate for full reproducibility.",
      +        "type": "string"
      +      },
      +      "contextUsed": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "approvalContext": {
      +            "type": "boolean"
      +          },
      +          "contract": {
      +            "type": "boolean"
      +          },
      +          "historicalInvoices": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "paymentHistory": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "purchaseOrder": {
      +            "type": "boolean"
      +          },
      +          "supplierHistoryMatched": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "supplierProfile": {
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "historicalInvoices",
      +          "supplierHistoryMatched",
      +          "paymentHistory",
      +          "supplierProfile",
      +          "purchaseOrder",
      +          "contract",
      +          "approvalContext"
      +        ],
      +        "type": "object"
      +      },
      +      "dataCompleteness": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "missingRecommendedFields": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "missingRequiredFields": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "missingRequiredFields",
      +          "missingRecommendedFields"
      +        ],
      +        "type": "object"
      +      },
      +      "decision": {
      +        "description": "Advisory only: low → continue, medium/high → review, critical → hold. Not a payment approval or rejection.",
      +        "enum": [
      +          "continue",
      +          "review",
      +          "hold"
      +        ],
      +        "type": "string"
      +      },
      +      "financialChecks": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "computed": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "expectedTax": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "expectedTotal": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "lineItemsSum": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "tolerance": {
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "lineItemsSum",
      +              "expectedTax",
      +              "expectedTotal",
      +              "tolerance"
      +            ],
      +            "type": "object"
      +          },
      +          "lineTotalsValid": {
      +            "description": "quantity × unitPrice − discount ≈ line total for every line that states all three; null when none does.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "subtotalValid": {
      +            "description": "Σ line totals ≈ subtotal; null when not checkable (no lines or no subtotal).",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "taxValid": {
      +            "description": "Stated tax ≈ tax implied by the stated rate(s); null when no rate or no tax is stated.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "totalValid": {
      +            "description": "subtotal − discount + tax + shipping ≈ total; null when not checkable.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "subtotalValid",
      +          "taxValid",
      +          "totalValid",
      +          "lineTotalsValid",
      +          "computed"
      +        ],
      +        "type": "object"
      +      },
      +      "invoiceSummary": {
      +        "additionalProperties": false,
      +        "description": "Normalized key fields of the checked invoice (bank account masked).",
      +        "properties": {
      +          "bankAccountMasked": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "currency": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "dueDate": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "invoiceDate": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "invoiceNumber": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "lineItemCount": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "supplierId": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "supplierName": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "total": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "invoiceNumber",
      +          "supplierName",
      +          "supplierId",
      +          "invoiceDate",
      +          "dueDate",
      +          "currency",
      +          "total",
      +          "lineItemCount",
      +          "bankAccountMasked"
      +        ],
      +        "type": "object"
      +      },
      +      "limitations": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "mode": {
      +        "enum": [
      +          "standalone",
      +          "context_aware"
      +        ],
      +        "type": "string"
      +      },
      +      "recommendedAction": {
      +        "type": "string"
      +      },
      +      "riskLevel": {
      +        "description": "low 0–14, medium 15–39, high 40–64, critical 65–100.",
      +        "enum": [
      +          "low",
      +          "medium",
      +          "high",
      +          "critical"
      +        ],
      +        "type": "string"
      +      },
      +      "riskScore": {
      +        "description": "0–100, higher = more risk indicators; see scoring for the exact computation.",
      +        "maximum": 100,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "scoring": {
      +        "additionalProperties": false,
      +        "description": "Exact score derivation: per-anomaly points = basePoints × confidence, severity-group caps, correlation bonus, severity ceiling.",
      +        "properties": {
      +          "cappedBySeverity": {
      +            "type": "boolean"
      +          },
      +          "components": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "basePoints": {
      +                  "type": "number"
      +                },
      +                "code": {
      +                  "type": "string"
      +                },
      +                "confidence": {
      +                  "type": "number"
      +                },
      +                "points": {
      +                  "type": "number"
      +                },
      +                "severity": {
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "code",
      +                "severity",
      +                "confidence",
      +                "basePoints",
      +                "points"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "escalationBonus": {
      +            "type": "number"
      +          },
      +          "escalationReasons": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "highSeverityPoints": {
      +            "type": "number"
      +          },
      +          "levelBands": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "critical": {
      +                "type": "string"
      +              },
      +              "high": {
      +                "type": "string"
      +              },
      +              "low": {
      +                "type": "string"
      +              },
      +              "medium": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "low",
      +              "medium",
      +              "high",
      +              "critical"
      +            ],
      +            "type": "object"
      +          },
      +          "lowSeverityPoints": {
      +            "type": "number"
      +          },
      +          "mediumSeverityPoints": {
      +            "type": "number"
      +          },
      +          "model": {
      +            "type": "string"
      +          },
      +          "rawScore": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "model",
      +          "components",
      +          "lowSeverityPoints",
      +          "mediumSeverityPoints",
      +          "highSeverityPoints",
      +          "escalationBonus",
      +          "escalationReasons",
      +          "cappedBySeverity",
      +          "rawScore",
      +          "levelBands"
      +        ],
      +        "type": "object"
      +      },
      +      "summary": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "riskScore",
      +      "riskLevel",
      +      "decision",
      +      "anomalyCount",
      +      "anomalies",
      +      "financialChecks",
      +      "recommendedAction",
      +      "summary",
      +      "mode",
      +      "contextUsed",
      +      "invoiceSummary",
      +      "dataCompleteness",
      +      "scoring",
      +      "limitations",
      +      "asOfDate",
      +      "checkedAt"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "nextAction": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "instruction": {
      +            "type": "string"
      +          },
      +          "target": {
      +            "enum": [
      +              "x402_endpoint",
      +              "mcp_credits_endpoint",
      +              "payment_endpoint",
      +              "unavailable"
      +            ],
      +            "type": "string"
      +          },
      +          "type": {
      +            "enum": [
      +              "pay_and_retry",
      +              "authorize_and_use_mcp_credits",
      +              "payment_unavailable"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type",
      +          "target",
      +          "instruction"
      +        ],
      +        "type": "object"
      +      },
      +      "payment": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "endpoint": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "method": {
      +            "const": "POST",
      +            "type": "string"
      +          },
      +          "retrySameBody": {
      +            "const": true,
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "endpoint",
      +          "method",
      +          "retrySameBody"
      +        ],
      +        "type": "object"
      +      },
      +      "paymentGuidance": {},
      +      "preview": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "fullResultAvailable": {
      +            "const": true,
      +            "type": "boolean"
      +          },
      +          "inputAccepted": {
      +            "const": true,
      +            "type": "boolean"
      +          },
      +          "summary": {
      +            "type": "string"
      +          },
      +          "useCases": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "inputAccepted",
      +          "fullResultAvailable",
      +          "summary",
      +          "useCases"
      +        ],
      +        "type": "object"
      +      },
      +      "price": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "amount": {
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "currency": {
      +            "type": "string"
      +          },
      +          "protocol": {
      +            "enum": [
      +              "x402",
      +              "api_credits",
      +              "subscription",
      +              "l402",
      +              "mpp",
      +              "unavailable"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "amount",
      +          "currency",
      +          "protocol"
      +        ],
      +        "type": "object"
      +      },
      +      "requestId": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "const": "payment_required",
      +        "type": "string"
      +      },
      +      "tool": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "status",
      +      "tool",
      +      "requestId",
      +      "price",
      +      "preview",
      +      "payment",
      +      "nextAction"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "anomalies": {
      -        "description": "Most severe first. At most one record per anomaly code; sub-findings are in evidence.issues.",
      -        "items": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "code": {
      -              "description": "Stable machine code of the anomaly type.",
      -              "enum": [
      -                "SUBTOTAL_MISMATCH",
      -                "TAX_MISMATCH",
      -                "TOTAL_MISMATCH",
      -                "LINE_TOTAL_MISMATCH",
      -                "DUPLICATE_INVOICE",
      -                "POSSIBLE_DUPLICATE",
      -                "UNUSUAL_AMOUNT",
      -                "SUPPLIER_PATTERN_DEVIATION",
      -                "UNUSUAL_CURRENCY",
      -                "UNUSUAL_PAYMENT_TERMS",
      -                "INVOICE_NUMBER_ANOMALY",
      -                "BANK_ACCOUNT_CHANGED",
      -                "UNKNOWN_BANK_ACCOUNT",
      -                "PO_MISMATCH",
      -                "PO_AMOUNT_EXCEEDED",
      -                "CONTRACT_LIMIT_EXCEEDED",
      -                "APPROVAL_THRESHOLD_EXCEEDED",
      -                "SPLIT_INVOICE_PATTERN",
      -                "DATE_ANOMALY",
      -                "DUE_DATE_ANOMALY",
      -                "DUPLICATE_LINE_ITEM",
      -                "MISSING_REQUIRED_FIELD"
      -              ],
      -              "type": "string"
      -            },
      -            "confidence": {
      -              "description": "0–1 strength of the supporting evidence (not a probability of fraud).",
      -              "maximum": 1,
      -              "minimum": 0,
      -              "type": "number"
      -            },
      -            "evidence": {
      -              "additionalProperties": {},
      -              "description": "Structured, factual evidence for the finding (matched records, expected vs stated values, baselines, thresholds). Bank accounts appear only masked (****1234).",
      -              "propertyNames": {
      -                "type": "string"
      -              },
      -              "type": "object"
      -            },
      -            "explanation": {
      -              "description": "One factual sentence, phrased as a risk indicator (never an accusation).",
      -              "type": "string"
      -            },
      -            "field": {
      -              "description": "Primary invoice field concerned (e.g. invoiceNumber, bankAccount, total), or null.",
      -              "type": [
      -                "string",
      -                "null"
      -              ]
      -            },
      -            "severity": {
      -              "enum": [
      -                "info",
      -                "low",
      -                "medium",
      -                "high",
      -                "critical"
      -              ],
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "code",
      -            "severity",
      -            "confidence",
      -            "field",
      -            "explanation",
      -            "evidence"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "anomalyCount": {
      -        "maximum": 9007199254740991,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "asOfDate": {
      -        "description": "Reference date (UTC) used for date checks.",
      -        "type": "string"
      -      },
      -      "checkedAt": {
      -        "description": "ISO timestamp of the as-of date (UTC start of day). Deliberately day-granular so identical inputs give identical output; pass options.asOfDate for full reproducibility.",
      -        "type": "string"
      -      },
      -      "contextUsed": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "approvalContext": {
      -            "type": "boolean"
      -          },
      -          "contract": {
      -            "type": "boolean"
      -          },
      -          "historicalInvoices": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "paymentHistory": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "purchaseOrder": {
      -            "type": "boolean"
      -          },
      -          "supplierHistoryMatched": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "supplierProfile": {
      -            "type": "boolean"
      -          }
      -        },
      -        "required": [
      -          "historicalInvoices",
      -          "supplierHistoryMatched",
      -          "paymentHistory",
      -          "supplierProfile",
      -          "purchaseOrder",
      -          "contract",
      -          "approvalContext"
      -        ],
      -        "type": "object"
      -      },
      -      "dataCompleteness": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "missingRecommendedFields": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          },
      -          "missingRequiredFields": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          }
      -        },
      -        "required": [
      -          "missingRequiredFields",
      -          "missingRecommendedFields"
      -        ],
      -        "type": "object"
      -      },
      -      "decision": {
      -        "description": "Advisory only: low → continue, medium/high → review, critical → hold. Not a payment approval or rejection.",
      -        "enum": [
      -          "continue",
      -          "review",
      -          "hold"
      -        ],
      -        "type": "string"
      -      },
      -      "financialChecks": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "computed": {
      -            "additionalProperties": false,
      -            "properties": {
      -              "expectedTax": {
      -                "type": [
      -                  "number",
      -                  "null"
      -                ]
      -              },
      -              "expectedTotal": {
      -                "type": [
      -                  "number",
      -                  "null"
      -                ]
      -              },
      -              "lineItemsSum": {
      -                "type": [
      -                  "number",
      -                  "null"
      -                ]
      -              },
      -              "tolerance": {
      -                "type": "number"
      -              }
      -            },
      -            "required": [
      -              "lineItemsSum",
      -              "expectedTax",
      -              "expectedTotal",
      -              "tolerance"
      -            ],
      -            "type": "object"
      -          },
      -          "lineTotalsValid": {
      -            "description": "quantity × unitPrice − discount ≈ line total for every line that states all three; null when none does.",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          },
      -          "subtotalValid": {
      -            "description": "Σ line totals ≈ subtotal; null when not checkable (no lines or no subtotal).",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          },
      -          "taxValid": {
      -            "description": "Stated tax ≈ tax implied by the stated rate(s); null when no rate or no tax is stated.",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          },
      -          "totalValid": {
      -            "description": "subtotal − discount + tax + shipping ≈ total; null when not checkable.",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          }
      -        },
      -        "required": [
      -          "subtotalValid",
      -          "taxValid",
      -          "totalValid",
      -          "lineTotalsValid",
      -          "computed"
      -        ],
      -        "type": "object"
      -      },
      -      "invoiceSummary": {
      -        "additionalProperties": false,
      -        "description": "Normalized key fields of the checked invoice (bank account masked).",
      -        "properties": {
      -          "bankAccountMasked": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "currency": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "dueDate": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "invoiceDate": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "invoiceNumber": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "lineItemCount": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "supplierId": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "supplierName": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "total": {
      -            "type": "number"
      -          }
      -        },
      -        "required": [
      -          "invoiceNumber",
      -          "supplierName",
      -          "supplierId",
      -          "invoiceDate",
      -          "dueDate",
      -          "currency",
      -          "total",
      -          "lineItemCount",
      -          "bankAccountMasked"
      -        ],
      -        "type": "object"
      -      },
      -      "limitations": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "mode": {
      -        "enum": [
      -          "standalone",
      -          "context_aware"
      -        ],
      -        "type": "string"
      -      },
      -      "recommendedAction": {
      -        "type": "string"
      -      },
      -      "riskLevel": {
      -        "description": "low 0–14, medium 15–39, high 40–64, critical 65–100.",
      -        "enum": [
      -          "low",
      -          "medium",
      -          "high",
      -          "critical"
      -        ],
      -        "type": "string"
      -      },
      -      "riskScore": {
      -        "description": "0–100, higher = more risk indicators; see scoring for the exact computation.",
      -        "maximum": 100,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "scoring": {
      -        "additionalProperties": false,
      -        "description": "Exact score derivation: per-anomaly points = basePoints × confidence, severity-group caps, correlation bonus, severity ceiling.",
      -        "properties": {
      -          "cappedBySeverity": {
      -            "type": "boolean"
      -          },
      -          "components": {
      -            "items": {
      -              "additionalProperties": false,
      -              "properties": {
      -                "basePoints": {
      -                  "type": "number"
      -                },
      -                "code": {
      -                  "type": "string"
      -                },
      -                "confidence": {
      -                  "type": "number"
      -                },
      -                "points": {
      -                  "type": "number"
      -                },
      -                "severity": {
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "code",
      -                "severity",
      -                "confidence",
      -                "basePoints",
      -                "points"
      -              ],
      -              "type": "object"
      -            },
      -            "type": "array"
      -          },
      -          "escalationBonus": {
      -            "type": "number"
      -          },
      -          "escalationReasons": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          },
      -          "highSeverityPoints": {
      -            "type": "number"
      -          },
      -          "levelBands": {
      -            "additionalProperties": false,
      -            "properties": {
      -              "critical": {
      -                "type": "string"
      -              },
      -              "high": {
      -                "type": "string"
      -              },
      -              "low": {
      -                "type": "string"
      -              },
      -              "medium": {
      -                "type": "string"
      -              }
      -            },
      -            "required": [
      -              "low",
      -              "medium",
      -              "high",
      -              "critical"
      -            ],
      -            "type": "object"
      -          },
      -          "lowSeverityPoints": {
      -            "type": "number"
      -          },
      -          "mediumSeverityPoints": {
      -            "type": "number"
      -          },
      -          "model": {
      -            "type": "string"
      -          },
      -          "rawScore": {
      -            "type": "number"
      -          }
      -        },
      -        "required": [
      -          "model",
      -          "components",
      -          "lowSeverityPoints",
      -          "mediumSeverityPoints",
      -          "highSeverityPoints",
      -          "escalationBonus",
      -          "escalationReasons",
      -          "cappedBySeverity",
      -          "rawScore",
      -          "levelBands"
      -        ],
      -        "type": "object"
      -      },
      -      "summary": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "riskScore",
      -      "riskLevel",
      -      "decision",
      -      "anomalyCount",
      -      "anomalies",
      -      "financialChecks",
      -      "recommendedAction",
      -      "summary",
      -      "mode",
      -      "contextUsed",
      -      "invoiceSummary",
      -      "dataCompleteness",
      -      "scoring",
      -      "limitations",
      -      "asOfDate",
      -      "checkedAt"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "nextAction": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "instruction": {
      -            "type": "string"
      -          },
      -          "target": {
      -            "enum": [
      -              "x402_endpoint",
      -              "mcp_credits_endpoint",
      -              "payment_endpoint",
      -              "unavailable"
      -            ],
      -            "type": "string"
      -          },
      -          "type": {
      -            "enum": [
      -              "pay_and_retry",
      -              "authorize_and_use_mcp_credits",
      -              "payment_unavailable"
      -            ],
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "type",
      -          "target",
      -          "instruction"
      -        ],
      -        "type": "object"
      -      },
      -      "payment": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "endpoint": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "method": {
      -            "const": "POST",
      -            "type": "string"
      -          },
      -          "retrySameBody": {
      -            "const": true,
      -            "type": "boolean"
      -          }
      -        },
      -        "required": [
      -          "endpoint",
      -          "method",
      -          "retrySameBody"
      -        ],
      -        "type": "object"
      -      },
      -      "paymentGuidance": {},
      -      "preview": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "fullResultAvailable": {
      -            "const": true,
      -            "type": "boolean"
      -          },
      -          "inputAccepted": {
      -            "const": true,
      -            "type": "boolean"
      -          },
      -          "summary": {
      -            "type": "string"
      -          },
      -          "useCases": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          }
      -        },
      -        "required": [
      -          "inputAccepted",
      -          "fullResultAvailable",
      -          "summary",
      -          "useCases"
      -        ],
      -        "type": "object"
      -      },
      -      "price": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "amount": {
      -            "minimum": 0,
      -            "type": "number"
      -          },
      -          "currency": {
      -            "type": "string"
      -          },
      -          "protocol": {
      -            "enum": [
      -              "x402",
      -              "api_credits",
      -              "subscription",
      -              "l402",
      -              "mpp",
      -              "unavailable"
      -            ],
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "amount",
      -          "currency",
      -          "protocol"
      -        ],
      -        "type": "object"
      -      },
      -      "requestId": {
      -        "type": "string"
      -      },
      -      "status": {
      -        "const": "payment_required",
      -        "type": "string"
      -      },
      -      "tool": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "status",
      -      "tool",
      -      "requestId",
      -      "price",
      -      "preview",
      -      "payment",
      -      "nextAction"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "anomalies": {
      +        "description": "Most severe first. At most one record per anomaly code; sub-findings are in evidence.issues.",
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "code": {
      +              "description": "Stable machine code of the anomaly type.",
      +              "enum": [
      +                "SUBTOTAL_MISMATCH",
      +                "TAX_MISMATCH",
      +                "TOTAL_MISMATCH",
      +                "LINE_TOTAL_MISMATCH",
      +                "DUPLICATE_INVOICE",
      +                "POSSIBLE_DUPLICATE",
      +                "UNUSUAL_AMOUNT",
      +                "SUPPLIER_PATTERN_DEVIATION",
      +                "UNUSUAL_CURRENCY",
      +                "UNUSUAL_PAYMENT_TERMS",
      +                "INVOICE_NUMBER_ANOMALY",
      +                "BANK_ACCOUNT_CHANGED",
      +                "UNKNOWN_BANK_ACCOUNT",
      +                "PO_MISMATCH",
      +                "PO_AMOUNT_EXCEEDED",
      +                "CONTRACT_LIMIT_EXCEEDED",
      +                "APPROVAL_THRESHOLD_EXCEEDED",
      +                "SPLIT_INVOICE_PATTERN",
      +                "DATE_ANOMALY",
      +                "DUE_DATE_ANOMALY",
      +                "DUPLICATE_LINE_ITEM",
      +                "MISSING_REQUIRED_FIELD"
      +              ],
      +              "type": "string"
      +            },
      +            "confidence": {
      +              "description": "0–1 strength of the supporting evidence (not a probability of fraud).",
      +              "maximum": 1,
      +              "minimum": 0,
      +              "type": "number"
      +            },
      +            "evidence": {
      +              "additionalProperties": {},
      +              "description": "Structured, factual evidence for the finding (matched records, expected vs stated values, baselines, thresholds). Bank accounts appear only masked (****1234).",
      +              "propertyNames": {
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "explanation": {
      +              "description": "One factual sentence, phrased as a risk indicator (never an accusation).",
      +              "type": "string"
      +            },
      +            "field": {
      +              "description": "Primary invoice field concerned (e.g. invoiceNumber, bankAccount, total), or null.",
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "severity": {
      +              "enum": [
      +                "info",
      +                "low",
      +                "medium",
      +                "high",
      +                "critical"
      +              ],
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "code",
      +            "severity",
      +            "confidence",
      +            "field",
      +            "explanation",
      +            "evidence"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "anomalyCount": {
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "asOfDate": {
      +        "description": "Reference date (UTC) used for date checks.",
      +        "type": "string"
      +      },
      +      "checkedAt": {
      +        "description": "ISO timestamp of the as-of date (UTC start of day). Deliberately day-granular so identical inputs give identical output; pass options.asOfDate for full reproducibility.",
      +        "type": "string"
      +      },
      +      "contextUsed": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "approvalContext": {
      +            "type": "boolean"
      +          },
      +          "contract": {
      +            "type": "boolean"
      +          },
      +          "historicalInvoices": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "paymentHistory": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "purchaseOrder": {
      +            "type": "boolean"
      +          },
      +          "supplierHistoryMatched": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "supplierProfile": {
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "historicalInvoices",
      +          "supplierHistoryMatched",
      +          "paymentHistory",
      +          "supplierProfile",
      +          "purchaseOrder",
      +          "contract",
      +          "approvalContext"
      +        ],
      +        "type": "object"
      +      },
      +      "dataCompleteness": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "missingRecommendedFields": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "missingRequiredFields": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "missingRequiredFields",
      +          "missingRecommendedFields"
      +        ],
      +        "type": "object"
      +      },
      +      "decision": {
      +        "description": "Advisory only: low → continue, medium/high → review, critical → hold. Not a payment approval or rejection.",
      +        "enum": [
      +          "continue",
      +          "review",
      +          "hold"
      +        ],
      +        "type": "string"
      +      },
      +      "financialChecks": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "computed": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "expectedTax": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "expectedTotal": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "lineItemsSum": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "tolerance": {
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "lineItemsSum",
      +              "expectedTax",
      +              "expectedTotal",
      +              "tolerance"
      +            ],
      +            "type": "object"
      +          },
      +          "lineTotalsValid": {
      +            "description": "quantity × unitPrice − discount ≈ line total for every line that states all three; null when none does.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "subtotalValid": {
      +            "description": "Σ line totals ≈ subtotal; null when not checkable (no lines or no subtotal).",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "taxValid": {
      +            "description": "Stated tax ≈ tax implied by the stated rate(s); null when no rate or no tax is stated.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "totalValid": {
      +            "description": "subtotal − discount + tax + shipping ≈ total; null when not checkable.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "subtotalValid",
      +          "taxValid",
      +          "totalValid",
      +          "lineTotalsValid",
      +          "computed"
      +        ],
      +        "type": "object"
      +      },
      +      "invoiceSummary": {
      +        "additionalProperties": false,
      +        "description": "Normalized key fields of the checked invoice (bank account masked).",
      +        "properties": {
      +          "bankAccountMasked": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "currency": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "dueDate": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "invoiceDate": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "invoiceNumber": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "lineItemCount": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "supplierId": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "supplierName": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "total": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "invoiceNumber",
      +          "supplierName",
      +          "supplierId",
      +          "invoiceDate",
      +          "dueDate",
      +          "currency",
      +          "total",
      +          "lineItemCount",
      +          "bankAccountMasked"
      +        ],
      +        "type": "object"
      +      },
      +      "limitations": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "mode": {
      +        "enum": [
      +          "standalone",
      +          "context_aware"
      +        ],
      +        "type": "string"
      +      },
      +      "recommendedAction": {
      +        "type": "string"
      +      },
      +      "riskLevel": {
      +        "description": "low 0–14, medium 15–39, high 40–64, critical 65–100.",
      +        "enum": [
      +          "low",
      +          "medium",
      +          "high",
      +          "critical"
      +        ],
      +        "type": "string"
      +      },
      +      "riskScore": {
      +        "description": "0–100, higher = more risk indicators; see scoring for the exact computation.",
      +        "maximum": 100,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "scoring": {
      +        "additionalProperties": false,
      +        "description": "Exact score derivation: per-anomaly points = basePoints × confidence, severity-group caps, correlation bonus, severity ceiling.",
      +        "properties": {
      +          "cappedBySeverity": {
      +            "type": "boolean"
      +          },
      +          "components": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "basePoints": {
      +                  "type": "number"
      +                },
      +                "code": {
      +                  "type": "string"
      +                },
      +                "confidence": {
      +                  "type": "number"
      +                },
      +                "points": {
      +                  "type": "number"
      +                },
      +                "severity": {
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "code",
      +                "severity",
      +                "confidence",
      +                "basePoints",
      +                "points"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "escalationBonus": {
      +            "type": "number"
      +          },
      +          "escalationReasons": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "highSeverityPoints": {
      +            "type": "number"
      +          },
      +          "levelBands": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "critical": {
      +                "type": "string"
      +              },
      +              "high": {
      +                "type": "string"
      +              },
      +              "low": {
      +                "type": "string"
      +              },
      +              "medium": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "low",
      +              "medium",
      +              "high",
      +              "critical"
      +            ],
      +            "type": "object"
      +          },
      +          "lowSeverityPoints": {
      +            "type": "number"
      +          },
      +          "mediumSeverityPoints": {
      +            "type": "number"
      +          },
      +          "model": {
      +            "type": "string"
      +          },
      +          "rawScore": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "model",
      +          "components",
      +          "lowSeverityPoints",
      +          "mediumSeverityPoints",
      +          "highSeverityPoints",
      +          "escalationBonus",
      +          "escalationReasons",
      +          "cappedBySeverity",
      +          "rawScore",
      +          "levelBands"
      +        ],
      +        "type": "object"
      +      },
      +      "summary": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "riskScore",
      +      "riskLevel",
      +      "decision",
      +      "anomalyCount",
      +      "anomalies",
      +      "financialChecks",
      +      "recommendedAction",
      +      "summary",
      +      "mode",
      +      "contextUsed",
      +      "invoiceSummary",
      +      "dataCompleteness",
      +      "scoring",
      +      "limitations",
      +      "asOfDate",
      +      "checkedAt"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "nextAction": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "instruction": {
      +            "type": "string"
      +          },
      +          "target": {
      +            "const": "x402_endpoint",
      +            "type": "string"
      +          },
      +          "type": {
      +            "const": "pay_and_retry",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type",
      +          "target",
      +          "instruction"
      +        ],
      +        "type": "object"
      +      },
      +      "payment": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "endpoint": {
      +            "type": "string"
      +          },
      +          "method": {
      +            "const": "POST",
      +            "type": "string"
      +          },
      +          "retrySameBody": {
      +            "const": true,
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "endpoint",
      +          "method",
      +          "retrySameBody"
      +        ],
      +        "type": "object"
      +      },
      +      "preview": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "fullResultAvailable": {
      +            "const": true,
      +            "type": "boolean"
      +          },
      +          "inputAccepted": {
      +            "const": true,
      +            "type": "boolean"
      +          },
      +          "summary": {
      +            "type": "string"
      +          },
      +          "useCases": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "inputAccepted",
      +          "fullResultAvailable",
      +          "summary",
      +          "useCases"
      +        ],
      +        "type": "object"
      +      },
      +      "price": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "amount": {
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "currency": {
      +            "type": "string"
      +          },
      +          "protocol": {
      +            "const": "x402",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "amount",
      +          "currency",
      +          "protocol"
      +        ],
      +        "type": "object"
      +      },
      +      "requestId": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "const": "payment_required",
      +        "type": "string"
      +      },
      +      "tool": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "status",
      +      "tool",
      +      "requestId",
      +      "price",
      +      "preview",
      +      "payment",
      +      "nextAction"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "anomalies": {
      -        "description": "Most severe first. At most one record per anomaly code; sub-findings are in evidence.issues.",
      -        "items": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "code": {
      -              "description": "Stable machine code of the anomaly type.",
      -              "enum": [
      -                "SUBTOTAL_MISMATCH",
      -                "TAX_MISMATCH",
      -                "TOTAL_MISMATCH",
      -                "LINE_TOTAL_MISMATCH",
      -                "DUPLICATE_INVOICE",
      -                "POSSIBLE_DUPLICATE",
      -                "UNUSUAL_AMOUNT",
      -                "SUPPLIER_PATTERN_DEVIATION",
      -                "UNUSUAL_CURRENCY",
      -                "UNUSUAL_PAYMENT_TERMS",
      -                "INVOICE_NUMBER_ANOMALY",
      -                "BANK_ACCOUNT_CHANGED",
      -                "UNKNOWN_BANK_ACCOUNT",
      -                "PO_MISMATCH",
      -                "PO_AMOUNT_EXCEEDED",
      -                "CONTRACT_LIMIT_EXCEEDED",
      -                "APPROVAL_THRESHOLD_EXCEEDED",
      -                "SPLIT_INVOICE_PATTERN",
      -                "DATE_ANOMALY",
      -                "DUE_DATE_ANOMALY",
      -                "DUPLICATE_LINE_ITEM",
      -                "MISSING_REQUIRED_FIELD"
      -              ],
      -              "type": "string"
      -            },
      -            "confidence": {
      -              "description": "0–1 strength of the supporting evidence (not a probability of fraud).",
      -              "maximum": 1,
      -              "minimum": 0,
      -              "type": "number"
      -            },
      -            "evidence": {
      -              "additionalProperties": {},
      -              "description": "Structured, factual evidence for the finding (matched records, expected vs stated values, baselines, thresholds). Bank accounts appear only masked (****1234).",
      -              "propertyNames": {
      -                "type": "string"
      -              },
      -              "type": "object"
      -            },
      -            "explanation": {
      -              "description": "One factual sentence, phrased as a risk indicator (never an accusation).",
      -              "type": "string"
      -            },
      -            "field": {
      -              "description": "Primary invoice field concerned (e.g. invoiceNumber, bankAccount, total), or null.",
      -              "type": [
      -                "string",
      -                "null"
      -              ]
      -            },
      -            "severity": {
      -              "enum": [
      -                "info",
      -                "low",
      -                "medium",
      -                "high",
      -                "critical"
      -              ],
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "code",
      -            "severity",
      -            "confidence",
      -            "field",
      -            "explanation",
      -            "evidence"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "anomalyCount": {
      -        "maximum": 9007199254740991,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "asOfDate": {
      -        "description": "Reference date (UTC) used for date checks.",
      -        "type": "string"
      -      },
      -      "checkedAt": {
      -        "description": "ISO timestamp of the as-of date (UTC start of day). Deliberately day-granular so identical inputs give identical output; pass options.asOfDate for full reproducibility.",
      -        "type": "string"
      -      },
      -      "contextUsed": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "approvalContext": {
      -            "type": "boolean"
      -          },
      -          "contract": {
      -            "type": "boolean"
      -          },
      -          "historicalInvoices": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "paymentHistory": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "purchaseOrder": {
      -            "type": "boolean"
      -          },
      -          "supplierHistoryMatched": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "supplierProfile": {
      -            "type": "boolean"
      -          }
      -        },
      -        "required": [
      -          "historicalInvoices",
      -          "supplierHistoryMatched",
      -          "paymentHistory",
      -          "supplierProfile",
      -          "purchaseOrder",
      -          "contract",
      -          "approvalContext"
      -        ],
      -        "type": "object"
      -      },
      -      "dataCompleteness": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "missingRecommendedFields": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          },
      -          "missingRequiredFields": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          }
      -        },
      -        "required": [
      -          "missingRequiredFields",
      -          "missingRecommendedFields"
      -        ],
      -        "type": "object"
      -      },
      -      "decision": {
      -        "description": "Advisory only: low → continue, medium/high → review, critical → hold. Not a payment approval or rejection.",
      -        "enum": [
      -          "continue",
      -          "review",
      -          "hold"
      -        ],
      -        "type": "string"
      -      },
      -      "financialChecks": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "computed": {
      -            "additionalProperties": false,
      -            "properties": {
      -              "expectedTax": {
      -                "type": [
      -                  "number",
      -                  "null"
      -                ]
      -              },
      -              "expectedTotal": {
      -                "type": [
      -                  "number",
      -                  "null"
      -                ]
      -              },
      -              "lineItemsSum": {
      -                "type": [
      -                  "number",
      -                  "null"
      -                ]
      -              },
      -              "tolerance": {
      -                "type": "number"
      -              }
      -            },
      -            "required": [
      -              "lineItemsSum",
      -              "expectedTax",
      -              "expectedTotal",
      -              "tolerance"
      -            ],
      -            "type": "object"
      -          },
      -          "lineTotalsValid": {
      -            "description": "quantity × unitPrice − discount ≈ line total for every line that states all three; null when none does.",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          },
      -          "subtotalValid": {
      -            "description": "Σ line totals ≈ subtotal; null when not checkable (no lines or no subtotal).",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          },
      -          "taxValid": {
      -            "description": "Stated tax ≈ tax implied by the stated rate(s); null when no rate or no tax is stated.",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          },
      -          "totalValid": {
      -            "description": "subtotal − discount + tax + shipping ≈ total; null when not checkable.",
      -            "type": [
      -              "boolean",
      -              "null"
      -            ]
      -          }
      -        },
      -        "required": [
      -          "subtotalValid",
      -          "taxValid",
      -          "totalValid",
      -          "lineTotalsValid",
      -          "computed"
      -        ],
      -        "type": "object"
      -      },
      -      "invoiceSummary": {
      -        "additionalProperties": false,
      -        "description": "Normalized key fields of the checked invoice (bank account masked).",
      -        "properties": {
      -          "bankAccountMasked": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "currency": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "dueDate": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "invoiceDate": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "invoiceNumber": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "lineItemCount": {
      -            "maximum": 9007199254740991,
      -            "minimum": -9007199254740991,
      -            "type": "integer"
      -          },
      -          "supplierId": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "supplierName": {
      -            "type": [
      -              "string",
      -              "null"
      -            ]
      -          },
      -          "total": {
      -            "type": "number"
      -          }
      -        },
      -        "required": [
      -          "invoiceNumber",
      -          "supplierName",
      -          "supplierId",
      -          "invoiceDate",
      -          "dueDate",
      -          "currency",
      -          "total",
      -          "lineItemCount",
      -          "bankAccountMasked"
      -        ],
      -        "type": "object"
      -      },
      -      "limitations": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "mode": {
      -        "enum": [
      -          "standalone",
      -          "context_aware"
      -        ],
      -        "type": "string"
      -      },
      -      "recommendedAction": {
      -        "type": "string"
      -      },
      -      "riskLevel": {
      -        "description": "low 0–14, medium 15–39, high 40–64, critical 65–100.",
      -        "enum": [
      -          "low",
      -          "medium",
      -          "high",
      -          "critical"
      -        ],
      -        "type": "string"
      -      },
      -      "riskScore": {
      -        "description": "0–100, higher = more risk indicators; see scoring for the exact computation.",
      -        "maximum": 100,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "scoring": {
      -        "additionalProperties": false,
      -        "description": "Exact score derivation: per-anomaly points = basePoints × confidence, severity-group caps, correlation bonus, severity ceiling.",
      -        "properties": {
      -          "cappedBySeverity": {
      -            "type": "boolean"
      -          },
      -          "components": {
      -            "items": {
      -              "additionalProperties": false,
      -              "properties": {
      -                "basePoints": {
      -                  "type": "number"
      -                },
      -                "code": {
      -                  "type": "string"
      -                },
      -                "confidence": {
      -                  "type": "number"
      -                },
      -                "points": {
      -                  "type": "number"
      -                },
      -                "severity": {
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "code",
      -                "severity",
      -                "confidence",
      -                "basePoints",
      -                "points"
      -              ],
      -              "type": "object"
      -            },
      -            "type": "array"
      -          },
      -          "escalationBonus": {
      -            "type": "number"
      -          },
      -          "escalationReasons": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          },
      -          "highSeverityPoints": {
      -            "type": "number"
      -          },
      -          "levelBands": {
      -            "additionalProperties": false,
      -            "properties": {
      -              "critical": {
      -                "type": "string"
      -              },
      -              "high": {
      -                "type": "string"
      -              },
      -              "low": {
      -                "type": "string"
      -              },
      -              "medium": {
      -                "type": "string"
      -              }
      -            },
      -            "required": [
      -              "low",
      -              "medium",
      -              "high",
      -              "critical"
      -            ],
      -            "type": "object"
      -          },
      -          "lowSeverityPoints": {
      -            "type": "number"
      -          },
      -          "mediumSeverityPoints": {
      -            "type": "number"
      -          },
      -          "model": {
      -            "type": "string"
      -          },
      -          "rawScore": {
      -            "type": "number"
      -          }
      -        },
      -        "required": [
      -          "model",
      -          "components",
      -          "lowSeverityPoints",
      -          "mediumSeverityPoints",
      -          "highSeverityPoints",
      -          "escalationBonus",
      -          "escalationReasons",
      -          "cappedBySeverity",
      -          "rawScore",
      -          "levelBands"
      -        ],
      -        "type": "object"
      -      },
      -      "summary": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "riskScore",
      -      "riskLevel",
      -      "decision",
      -      "anomalyCount",
      -      "anomalies",
      -      "financialChecks",
      -      "recommendedAction",
      -      "summary",
      -      "mode",
      -      "contextUsed",
      -      "invoiceSummary",
      -      "dataCompleteness",
      -      "scoring",
      -      "limitations",
      -      "asOfDate",
      -      "checkedAt"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "nextAction": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "instruction": {
      -            "type": "string"
      -          },
      -          "target": {
      -            "const": "x402_endpoint",
      -            "type": "string"
      -          },
      -          "type": {
      -            "const": "pay_and_retry",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "type",
      -          "target",
      -          "instruction"
      -        ],
      -        "type": "object"
      -      },
      -      "payment": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "endpoint": {
      -            "type": "string"
      -          },
      -          "method": {
      -            "const": "POST",
      -            "type": "string"
      -          },
      -          "retrySameBody": {
      -            "const": true,
      -            "type": "boolean"
      -          }
      -        },
      -        "required": [
      -          "endpoint",
      -          "method",
      -          "retrySameBody"
      -        ],
      -        "type": "object"
      -      },
      -      "preview": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "fullResultAvailable": {
      -            "const": true,
      -            "type": "boolean"
      -          },
      -          "inputAccepted": {
      -            "const": true,
      -            "type": "boolean"
      -          },
      -          "summary": {
      -            "type": "string"
      -          },
      -          "useCases": {
      -            "items": {
      -              "type": "string"
      -            },
      -            "type": "array"
      -          }
      -        },
      -        "required": [
      -          "inputAccepted",
      -          "fullResultAvailable",
      -          "summary",
      -          "useCases"
      -        ],
      -        "type": "object"
      -      },
      -      "price": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "amount": {
      -            "minimum": 0,
      -            "type": "number"
      -          },
      -          "currency": {
      -            "type": "string"
      -          },
      -          "protocol": {
      -            "const": "x402",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "amount",
      -          "currency",
      -          "protocol"
      -        ],
      -        "type": "object"
      -      },
      -      "requestId": {
      -        "type": "string"
      -      },
      -      "status": {
      -        "const": "payment_required",
      -        "type": "string"
      -      },
      -      "tool": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "status",
      -      "tool",
      -      "requestId",
      -      "price",
      -      "preview",
      -      "payment",
      -      "nextAction"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "anomalies": {
      +        "description": "Most severe first. At most one record per anomaly code; sub-findings are in evidence.issues.",
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "code": {
      +              "description": "Stable machine code of the anomaly type.",
      +              "enum": [
      +                "SUBTOTAL_MISMATCH",
      +                "TAX_MISMATCH",
      +                "TOTAL_MISMATCH",
      +                "LINE_TOTAL_MISMATCH",
      +                "DUPLICATE_INVOICE",
      +                "POSSIBLE_DUPLICATE",
      +                "UNUSUAL_AMOUNT",
      +                "SUPPLIER_PATTERN_DEVIATION",
      +                "UNUSUAL_CURRENCY",
      +                "UNUSUAL_PAYMENT_TERMS",
      +                "INVOICE_NUMBER_ANOMALY",
      +                "BANK_ACCOUNT_CHANGED",
      +                "UNKNOWN_BANK_ACCOUNT",
      +                "PO_MISMATCH",
      +                "PO_AMOUNT_EXCEEDED",
      +                "CONTRACT_LIMIT_EXCEEDED",
      +                "APPROVAL_THRESHOLD_EXCEEDED",
      +                "SPLIT_INVOICE_PATTERN",
      +                "DATE_ANOMALY",
      +                "DUE_DATE_ANOMALY",
      +                "DUPLICATE_LINE_ITEM",
      +                "MISSING_REQUIRED_FIELD"
      +              ],
      +              "type": "string"
      +            },
      +            "confidence": {
      +              "description": "0–1 strength of the supporting evidence (not a probability of fraud).",
      +              "maximum": 1,
      +              "minimum": 0,
      +              "type": "number"
      +            },
      +            "evidence": {
      +              "additionalProperties": {},
      +              "description": "Structured, factual evidence for the finding (matched records, expected vs stated values, baselines, thresholds). Bank accounts appear only masked (****1234).",
      +              "propertyNames": {
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "explanation": {
      +              "description": "One factual sentence, phrased as a risk indicator (never an accusation).",
      +              "type": "string"
      +            },
      +            "field": {
      +              "description": "Primary invoice field concerned (e.g. invoiceNumber, bankAccount, total), or null.",
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "severity": {
      +              "enum": [
      +                "info",
      +                "low",
      +                "medium",
      +                "high",
      +                "critical"
      +              ],
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "code",
      +            "severity",
      +            "confidence",
      +            "field",
      +            "explanation",
      +            "evidence"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "anomalyCount": {
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "asOfDate": {
      +        "description": "Reference date (UTC) used for date checks.",
      +        "type": "string"
      +      },
      +      "checkedAt": {
      +        "description": "ISO timestamp of the as-of date (UTC start of day). Deliberately day-granular so identical inputs give identical output; pass options.asOfDate for full reproducibility.",
      +        "type": "string"
      +      },
      +      "contextUsed": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "approvalContext": {
      +            "type": "boolean"
      +          },
      +          "contract": {
      +            "type": "boolean"
      +          },
      +          "historicalInvoices": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "paymentHistory": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "purchaseOrder": {
      +            "type": "boolean"
      +          },
      +          "supplierHistoryMatched": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "supplierProfile": {
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "historicalInvoices",
      +          "supplierHistoryMatched",
      +          "paymentHistory",
      +          "supplierProfile",
      +          "purchaseOrder",
      +          "contract",
      +          "approvalContext"
      +        ],
      +        "type": "object"
      +      },
      +      "dataCompleteness": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "missingRecommendedFields": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "missingRequiredFields": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "missingRequiredFields",
      +          "missingRecommendedFields"
      +        ],
      +        "type": "object"
      +      },
      +      "decision": {
      +        "description": "Advisory only: low → continue, medium/high → review, critical → hold. Not a payment approval or rejection.",
      +        "enum": [
      +          "continue",
      +          "review",
      +          "hold"
      +        ],
      +        "type": "string"
      +      },
      +      "financialChecks": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "computed": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "expectedTax": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "expectedTotal": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "lineItemsSum": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "tolerance": {
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "lineItemsSum",
      +              "expectedTax",
      +              "expectedTotal",
      +              "tolerance"
      +            ],
      +            "type": "object"
      +          },
      +          "lineTotalsValid": {
      +            "description": "quantity × unitPrice − discount ≈ line total for every line that states all three; null when none does.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "subtotalValid": {
      +            "description": "Σ line totals ≈ subtotal; null when not checkable (no lines or no subtotal).",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "taxValid": {
      +            "description": "Stated tax ≈ tax implied by the stated rate(s); null when no rate or no tax is stated.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "totalValid": {
      +            "description": "subtotal − discount + tax + shipping ≈ total; null when not checkable.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "subtotalValid",
      +          "taxValid",
      +          "totalValid",
      +          "lineTotalsValid",
      +          "computed"
      +        ],
      +        "type": "object"
      +      },
      +      "invoiceSummary": {
      +        "additionalProperties": false,
      +        "description": "Normalized key fields of the checked invoice (bank account masked).",
      +        "properties": {
      +          "bankAccountMasked": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "currency": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "dueDate": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "invoiceDate": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "invoiceNumber": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "lineItemCount": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "supplierId": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "supplierName": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "total": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "invoiceNumber",
      +          "supplierName",
      +          "supplierId",
      +          "invoiceDate",
      +          "dueDate",
      +          "currency",
      +          "total",
      +          "lineItemCount",
      +          "bankAccountMasked"
      +        ],
      +        "type": "object"
      +      },
      +      "limitations": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "mode": {
      +        "enum": [
      +          "standalone",
      +          "context_aware"
      +        ],
      +        "type": "string"
      +      },
      +      "recommendedAction": {
      +        "type": "string"
      +      },
      +      "riskLevel": {
      +        "description": "low 0–14, medium 15–39, high 40–64, critical 65–100.",
      +        "enum": [
      +          "low",
      +          "medium",
      +          "high",
      +          "critical"
      +        ],
      +        "type": "string"
      +      },
      +      "riskScore": {
      +        "description": "0–100, higher = more risk indicators; see scoring for the exact computation.",
      +        "maximum": 100,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "scoring": {
      +        "additionalProperties": false,
      +        "description": "Exact score derivation: per-anomaly points = basePoints × confidence, severity-group caps, correlation bonus, severity ceiling.",
      +        "properties": {
      +          "cappedBySeverity": {
      +            "type": "boolean"
      +          },
      +          "components": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "basePoints": {
      +                  "type": "number"
      +                },
      +                "code": {
      +                  "type": "string"
      +                },
      +                "confidence": {
      +                  "type": "number"
      +                },
      +                "points": {
      +                  "type": "number"
      +                },
      +                "severity": {
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "code",
      +                "severity",
      +                "confidence",
      +                "basePoints",
      +                "points"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "escalationBonus": {
      +            "type": "number"
      +          },
      +          "escalationReasons": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "highSeverityPoints": {
      +            "type": "number"
      +          },
      +          "levelBands": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "critical": {
      +                "type": "string"
      +              },
      +              "high": {
      +                "type": "string"
      +              },
      +              "low": {
      +                "type": "string"
      +              },
      +              "medium": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "low",
      +              "medium",
      +              "high",
      +              "critical"
      +            ],
      +            "type": "object"
      +          },
      +          "lowSeverityPoints": {
      +            "type": "number"
      +          },
      +          "mediumSeverityPoints": {
      +            "type": "number"
      +          },
      +          "model": {
      +            "type": "string"
      +          },
      +          "rawScore": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "model",
      +          "components",
      +          "lowSeverityPoints",
      +          "mediumSeverityPoints",
      +          "highSeverityPoints",
      +          "escalationBonus",
      +          "escalationReasons",
      +          "cappedBySeverity",
      +          "rawScore",
      +          "levelBands"
      +        ],
      +        "type": "object"
      +      },
      +      "summary": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "riskScore",
      +      "riskLevel",
      +      "decision",
      +      "anomalyCount",
      +      "anomalies",
      +      "financialChecks",
      +      "recommendedAction",
      +      "summary",
      +      "mode",
      +      "contextUsed",
      +      "invoiceSummary",
      +      "dataCompleteness",
      +      "scoring",
      +      "limitations",
      +      "asOfDate",
      +      "checkedAt"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "nextAction": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "instruction": {
      +            "type": "string"
      +          },
      +          "target": {
      +            "enum": [
      +              "x402_endpoint",
      +              "mcp_credits_endpoint",
      +              "payment_endpoint",
      +              "unavailable"
      +            ],
      +            "type": "string"
      +          },
      +          "type": {
      +            "enum": [
      +              "pay_and_retry",
      +              "authorize_and_use_mcp_credits",
      +              "payment_unavailable"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type",
      +          "target",
      +          "instruction"
      +        ],
      +        "type": "object"
      +      },
      +      "payment": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "endpoint": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "method": {
      +            "const": "POST",
      +            "type": "string"
      +          },
      +          "retrySameBody": {
      +            "const": true,
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "endpoint",
      +          "method",
      +          "retrySameBody"
      +        ],
      +        "type": "object"
      +      },
      +      "paymentGuidance": {},
      +      "preview": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "fullResultAvailable": {
      +            "const": true,
      +            "type": "boolean"
      +          },
      +          "inputAccepted": {
      +            "const": true,
      +            "type": "boolean"
      +          },
      +          "summary": {
      +            "type": "string"
      +          },
      +          "useCases": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "inputAccepted",
      +          "fullResultAvailable",
      +          "summary",
      +          "useCases"
      +        ],
      +        "type": "object"
      +      },
      +      "price": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "amount": {
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "currency": {
      +            "type": "string"
      +          },
      +          "protocol": {
      +            "enum": [
      +              "x402",
      +              "api_credits",
      +              "subscription",
      +              "l402",
      +              "mpp",
      +              "unavailable"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "amount",
      +          "currency",
      +          "protocol"
      +        ],
      +        "type": "object"
      +      },
      +      "requestId": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "const": "payment_required",
      +        "type": "string"
      +      },
      +      "tool": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "status",
      +      "tool",
      +      "requestId",
      +      "price",
      +      "preview",
      +      "payment",
      +      "nextAction"
      +    ],
      +    "type": "object"
      +  }
      +]
  4. Changed4 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -false
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "anomalies": {
      +        "description": "Most severe first. At most one record per anomaly code; sub-findings are in evidence.issues.",
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "code": {
      +              "description": "Stable machine code of the anomaly type.",
      +              "enum": [
      +                "SUBTOTAL_MISMATCH",
      +                "TAX_MISMATCH",
      +                "TOTAL_MISMATCH",
      +                "LINE_TOTAL_MISMATCH",
      +                "DUPLICATE_INVOICE",
      +                "POSSIBLE_DUPLICATE",
      +                "UNUSUAL_AMOUNT",
      +                "SUPPLIER_PATTERN_DEVIATION",
      +                "UNUSUAL_CURRENCY",
      +                "UNUSUAL_PAYMENT_TERMS",
      +                "INVOICE_NUMBER_ANOMALY",
      +                "BANK_ACCOUNT_CHANGED",
      +                "UNKNOWN_BANK_ACCOUNT",
      +                "PO_MISMATCH",
      +                "PO_AMOUNT_EXCEEDED",
      +                "CONTRACT_LIMIT_EXCEEDED",
      +                "APPROVAL_THRESHOLD_EXCEEDED",
      +                "SPLIT_INVOICE_PATTERN",
      +                "DATE_ANOMALY",
      +                "DUE_DATE_ANOMALY",
      +                "DUPLICATE_LINE_ITEM",
      +                "MISSING_REQUIRED_FIELD"
      +              ],
      +              "type": "string"
      +            },
      +            "confidence": {
      +              "description": "0–1 strength of the supporting evidence (not a probability of fraud).",
      +              "maximum": 1,
      +              "minimum": 0,
      +              "type": "number"
      +            },
      +            "evidence": {
      +              "additionalProperties": {},
      +              "description": "Structured, factual evidence for the finding (matched records, expected vs stated values, baselines, thresholds). Bank accounts appear only masked (****1234).",
      +              "propertyNames": {
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "explanation": {
      +              "description": "One factual sentence, phrased as a risk indicator (never an accusation).",
      +              "type": "string"
      +            },
      +            "field": {
      +              "description": "Primary invoice field concerned (e.g. invoiceNumber, bankAccount, total), or null.",
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "severity": {
      +              "enum": [
      +                "info",
      +                "low",
      +                "medium",
      +                "high",
      +                "critical"
      +              ],
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "code",
      +            "severity",
      +            "confidence",
      +            "field",
      +            "explanation",
      +            "evidence"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "anomalyCount": {
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "asOfDate": {
      +        "description": "Reference date (UTC) used for date checks.",
      +        "type": "string"
      +      },
      +      "checkedAt": {
      +        "description": "ISO timestamp of the as-of date (UTC start of day). Deliberately day-granular so identical inputs give identical output; pass options.asOfDate for full reproducibility.",
      +        "type": "string"
      +      },
      +      "contextUsed": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "approvalContext": {
      +            "type": "boolean"
      +          },
      +          "contract": {
      +            "type": "boolean"
      +          },
      +          "historicalInvoices": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "paymentHistory": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "purchaseOrder": {
      +            "type": "boolean"
      +          },
      +          "supplierHistoryMatched": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "supplierProfile": {
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "historicalInvoices",
      +          "supplierHistoryMatched",
      +          "paymentHistory",
      +          "supplierProfile",
      +          "purchaseOrder",
      +          "contract",
      +          "approvalContext"
      +        ],
      +        "type": "object"
      +      },
      +      "dataCompleteness": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "missingRecommendedFields": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "missingRequiredFields": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "missingRequiredFields",
      +          "missingRecommendedFields"
      +        ],
      +        "type": "object"
      +      },
      +      "decision": {
      +        "description": "Advisory only: low → continue, medium/high → review, critical → hold. Not a payment approval or rejection.",
      +        "enum": [
      +          "continue",
      +          "review",
      +          "hold"
      +        ],
      +        "type": "string"
      +      },
      +      "financialChecks": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "computed": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "expectedTax": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "expectedTotal": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "lineItemsSum": {
      +                "type": [
      +                  "number",
      +                  "null"
      +                ]
      +              },
      +              "tolerance": {
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "lineItemsSum",
      +              "expectedTax",
      +              "expectedTotal",
      +              "tolerance"
      +            ],
      +            "type": "object"
      +          },
      +          "lineTotalsValid": {
      +            "description": "quantity × unitPrice − discount ≈ line total for every line that states all three; null when none does.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "subtotalValid": {
      +            "description": "Σ line totals ≈ subtotal; null when not checkable (no lines or no subtotal).",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "taxValid": {
      +            "description": "Stated tax ≈ tax implied by the stated rate(s); null when no rate or no tax is stated.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "totalValid": {
      +            "description": "subtotal − discount + tax + shipping ≈ total; null when not checkable.",
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "subtotalValid",
      +          "taxValid",
      +          "totalValid",
      +          "lineTotalsValid",
      +          "computed"
      +        ],
      +        "type": "object"
      +      },
      +      "invoiceSummary": {
      +        "additionalProperties": false,
      +        "description": "Normalized key fields of the checked invoice (bank account masked).",
      +        "properties": {
      +          "bankAccountMasked": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "currency": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "dueDate": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "invoiceDate": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "invoiceNumber": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "lineItemCount": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "supplierId": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "supplierName": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "total": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "invoiceNumber",
      +          "supplierName",
      +          "supplierId",
      +          "invoiceDate",
      +          "dueDate",
      +          "currency",
      +          "total",
      +          "lineItemCount",
      +          "bankAccountMasked"
      +        ],
      +        "type": "object"
      +      },
      +      "limitations": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "mode": {
      +        "enum": [
      +          "standalone",
      +          "context_aware"
      +        ],
      +        "type": "string"
      +      },
      +      "recommendedAction": {
      +        "type": "string"
      +      },
      +      "riskLevel": {
      +        "description": "low 0–14, medium 15–39, high 40–64, critical 65–100.",
      +        "enum": [
      +          "low",
      +          "medium",
      +          "high",
      +          "critical"
      +        ],
      +        "type": "string"
      +      },
      +      "riskScore": {
      +        "description": "0–100, higher = more risk indicators; see scoring for the exact computation.",
      +        "maximum": 100,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "scoring": {
      +        "additionalProperties": false,
      +        "description": "Exact score derivation: per-anomaly points = basePoints × confidence, severity-group caps, correlation bonus, severity ceiling.",
      +        "properties": {
      +          "cappedBySeverity": {
      +            "type": "boolean"
      +          },
      +          "components": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "basePoints": {
      +                  "type": "number"
      +                },
      +                "code": {
      +                  "type": "string"
      +                },
      +                "confidence": {
      +                  "type": "number"
      +                },
      +                "points": {
      +                  "type": "number"
      +                },
      +                "severity": {
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "code",
      +                "severity",
      +                "confidence",
      +                "basePoints",
      +                "points"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "escalationBonus": {
      +            "type": "number"
      +          },
      +          "escalationReasons": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "highSeverityPoints": {
      +            "type": "number"
      +          },
      +          "levelBands": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "critical": {
      +                "type": "string"
      +              },
      +              "high": {
      +                "type": "string"
      +              },
      +              "low": {
      +                "type": "string"
      +              },
      +              "medium": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "low",
      +              "medium",
      +              "high",
      +              "critical"
      +            ],
      +            "type": "object"
      +          },
      +          "lowSeverityPoints": {
      +            "type": "number"
      +          },
      +          "mediumSeverityPoints": {
      +            "type": "number"
      +          },
      +          "model": {
      +            "type": "string"
      +          },
      +          "rawScore": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "model",
      +          "components",
      +          "lowSeverityPoints",
      +          "mediumSeverityPoints",
      +          "highSeverityPoints",
      +          "escalationBonus",
      +          "escalationReasons",
      +          "cappedBySeverity",
      +          "rawScore",
      +          "levelBands"
      +        ],
      +        "type": "object"
      +      },
      +      "summary": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "riskScore",
      +      "riskLevel",
      +      "decision",
      +      "anomalyCount",
      +      "anomalies",
      +      "financialChecks",
      +      "recommendedAction",
      +      "summary",
      +      "mode",
      +      "contextUsed",
      +      "invoiceSummary",
      +      "dataCompleteness",
      +      "scoring",
      +      "limitations",
      +      "asOfDate",
      +      "checkedAt"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "nextAction": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "instruction": {
      +            "type": "string"
      +          },
      +          "target": {
      +            "const": "x402_endpoint",
      +            "type": "string"
      +          },
      +          "type": {
      +            "const": "pay_and_retry",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type",
      +          "target",
      +          "instruction"
      +        ],
      +        "type": "object"
      +      },
      +      "payment": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "endpoint": {
      +            "type": "string"
      +          },
      +          "method": {
      +            "const": "POST",
      +            "type": "string"
      +          },
      +          "retrySameBody": {
      +            "const": true,
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "endpoint",
      +          "method",
      +          "retrySameBody"
      +        ],
      +        "type": "object"
      +      },
      +      "preview": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "fullResultAvailable": {
      +            "const": true,
      +            "type": "boolean"
      +          },
      +          "inputAccepted": {
      +            "const": true,
      +            "type": "boolean"
      +          },
      +          "summary": {
      +            "type": "string"
      +          },
      +          "useCases": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "inputAccepted",
      +          "fullResultAvailable",
      +          "summary",
      +          "useCases"
      +        ],
      +        "type": "object"
      +      },
      +      "price": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "amount": {
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "currency": {
      +            "type": "string"
      +          },
      +          "protocol": {
      +            "const": "x402",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "amount",
      +          "currency",
      +          "protocol"
      +        ],
      +        "type": "object"
      +      },
      +      "requestId": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "const": "payment_required",
      +        "type": "string"
      +      },
      +      "tool": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "status",
      +      "tool",
      +      "requestId",
      +      "price",
      +      "preview",
      +      "payment",
      +      "nextAction"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / properties
      Removed value: -{
      -  "anomalies": {
      -    "description": "Most severe first. At most one record per anomaly code; sub-findings are in evidence.issues.",
      -    "items": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "code": {
      -          "description": "Stable machine code of the anomaly type.",
      -          "enum": [
      -            "SUBTOTAL_MISMATCH",
      -            "TAX_MISMATCH",
      -            "TOTAL_MISMATCH",
      -            "LINE_TOTAL_MISMATCH",
      -            "DUPLICATE_INVOICE",
      -            "POSSIBLE_DUPLICATE",
      -            "UNUSUAL_AMOUNT",
      -            "SUPPLIER_PATTERN_DEVIATION",
      -            "UNUSUAL_CURRENCY",
      -            "UNUSUAL_PAYMENT_TERMS",
      -            "INVOICE_NUMBER_ANOMALY",
      -            "BANK_ACCOUNT_CHANGED",
      -            "UNKNOWN_BANK_ACCOUNT",
      -            "PO_MISMATCH",
      -            "PO_AMOUNT_EXCEEDED",
      -            "CONTRACT_LIMIT_EXCEEDED",
      -            "APPROVAL_THRESHOLD_EXCEEDED",
      -            "SPLIT_INVOICE_PATTERN",
      -            "DATE_ANOMALY",
      -            "DUE_DATE_ANOMALY",
      -            "DUPLICATE_LINE_ITEM",
      -            "MISSING_REQUIRED_FIELD"
      -          ],
      -          "type": "string"
      -        },
      -        "confidence": {
      -          "description": "0–1 strength of the supporting evidence (not a probability of fraud).",
      -          "maximum": 1,
      -          "minimum": 0,
      -          "type": "number"
      -        },
      -        "evidence": {
      -          "additionalProperties": {},
      -          "description": "Structured, factual evidence for the finding (matched records, expected vs stated values, baselines, thresholds). Bank accounts appear only masked (****1234).",
      -          "propertyNames": {
      -            "type": "string"
      -          },
      -          "type": "object"
      -        },
      -        "explanation": {
      -          "description": "One factual sentence, phrased as a risk indicator (never an accusation).",
      -          "type": "string"
      -        },
      -        "field": {
      -          "description": "Primary invoice field concerned (e.g. invoiceNumber, bankAccount, total), or null.",
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "severity": {
      -          "enum": [
      -            "info",
      -            "low",
      -            "medium",
      -            "high",
      -            "critical"
      -          ],
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "code",
      -        "severity",
      -        "confidence",
      -        "field",
      -        "explanation",
      -        "evidence"
      -      ],
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "anomalyCount": {
      -    "maximum": 9007199254740991,
      -    "minimum": 0,
      -    "type": "integer"
      -  },
      -  "asOfDate": {
      -    "description": "Reference date (UTC) used for date checks.",
      -    "type": "string"
      -  },
      -  "checkedAt": {
      -    "description": "ISO timestamp of the as-of date (UTC start of day). Deliberately day-granular so identical inputs give identical output; pass options.asOfDate for full reproducibility.",
      -    "type": "string"
      -  },
      -  "contextUsed": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "approvalContext": {
      -        "type": "boolean"
      -      },
      -      "contract": {
      -        "type": "boolean"
      -      },
      -      "historicalInvoices": {
      -        "maximum": 9007199254740991,
      -        "minimum": -9007199254740991,
      -        "type": "integer"
      -      },
      -      "paymentHistory": {
      -        "maximum": 9007199254740991,
      -        "minimum": -9007199254740991,
      -        "type": "integer"
      -      },
      -      "purchaseOrder": {
      -        "type": "boolean"
      -      },
      -      "supplierHistoryMatched": {
      -        "maximum": 9007199254740991,
      -        "minimum": -9007199254740991,
      -        "type": "integer"
      -      },
      -      "supplierProfile": {
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "historicalInvoices",
      -      "supplierHistoryMatched",
      -      "paymentHistory",
      -      "supplierProfile",
      -      "purchaseOrder",
      -      "contract",
      -      "approvalContext"
      -    ],
      -    "type": "object"
      -  },
      -  "dataCompleteness": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "missingRecommendedFields": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "missingRequiredFields": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "missingRequiredFields",
      -      "missingRecommendedFields"
      -    ],
      -    "type": "object"
      -  },
      -  "decision": {
      -    "description": "Advisory only: low → continue, medium/high → review, critical → hold. Not a payment approval or rejection.",
      -    "enum": [
      -      "continue",
      -      "review",
      -      "hold"
      -    ],
      -    "type": "string"
      -  },
      -  "financialChecks": {
      -    "additionalProperties": false,
      -    "properties": {
      -      "computed": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "expectedTax": {
      -            "type": [
      -              "number",
      -              "null"
      -            ]
      -          },
      -          "expectedTotal": {
      -            "type": [
      -              "number",
      -              "null"
      -            ]
      -          },
      -          "lineItemsSum": {
      -            "type": [
      -              "number",
      -              "null"
      -            ]
      -          },
      -          "tolerance": {
      -            "type": "number"
      -          }
      -        },
      -        "required": [
      -          "lineItemsSum",
      -          "expectedTax",
      -          "expectedTotal",
      -          "tolerance"
      -        ],
      -        "type": "object"
      -      },
      -      "lineTotalsValid": {
      -        "description": "quantity × unitPrice − discount ≈ line total for every line that states all three; null when none does.",
      -        "type": [
      -          "boolean",
      -          "null"
      -        ]
      -      },
      -      "subtotalValid": {
      -        "description": "Σ line totals ≈ subtotal; null when not checkable (no lines or no subtotal).",
      -        "type": [
      -          "boolean",
      -          "null"
      -        ]
      -      },
      -      "taxValid": {
      -        "description": "Stated tax ≈ tax implied by the stated rate(s); null when no rate or no tax is stated.",
      -        "type": [
      -          "boolean",
      -          "null"
      -        ]
      -      },
      -      "totalValid": {
      -        "description": "subtotal − discount + tax + shipping ≈ total; null when not checkable.",
      -        "type": [
      -          "boolean",
      -          "null"
      -        ]
      -      }
      -    },
      -    "required": [
      -      "subtotalValid",
      -      "taxValid",
      -      "totalValid",
      -      "lineTotalsValid",
      -      "computed"
      -    ],
      -    "type": "object"
      -  },
      -  "invoiceSummary": {
      -    "additionalProperties": false,
      -    "description": "Normalized key fields of the checked invoice (bank account masked).",
      -    "properties": {
      -      "bankAccountMasked": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "currency": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "dueDate": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "invoiceDate": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "invoiceNumber": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "lineItemCount": {
      -        "maximum": 9007199254740991,
      -        "minimum": -9007199254740991,
      -        "type": "integer"
      -      },
      -      "supplierId": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "supplierName": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "total": {
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "invoiceNumber",
      -      "supplierName",
      -      "supplierId",
      -      "invoiceDate",
      -      "dueDate",
      -      "currency",
      -      "total",
      -      "lineItemCount",
      -      "bankAccountMasked"
      -    ],
      -    "type": "object"
      -  },
      -  "limitations": {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  "mode": {
      -    "enum": [
      -      "standalone",
      -      "context_aware"
      -    ],
      -    "type": "string"
      -  },
      -  "recommendedAction": {
      -    "type": "string"
      -  },
      -  "riskLevel": {
      -    "description": "low 0–14, medium 15–39, high 40–64, critical 65–100.",
      -    "enum": [
      -      "low",
      -      "medium",
      -      "high",
      -      "critical"
      -    ],
      -    "type": "string"
      -  },
      -  "riskScore": {
      -    "description": "0–100, higher = more risk indicators; see scoring for the exact computation.",
      -    "maximum": 100,
      -    "minimum": 0,
      -    "type": "integer"
      -  },
      -  "scoring": {
      -    "additionalProperties": false,
      -    "description": "Exact score derivation: per-anomaly points = basePoints × confidence, severity-group caps, correlation bonus, severity ceiling.",
      -    "properties": {
      -      "cappedBySeverity": {
      -        "type": "boolean"
      -      },
      -      "components": {
      -        "items": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "basePoints": {
      -              "type": "number"
      -            },
      -            "code": {
      -              "type": "string"
      -            },
      -            "confidence": {
      -              "type": "number"
      -            },
      -            "points": {
      -              "type": "number"
      -            },
      -            "severity": {
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "code",
      -            "severity",
      -            "confidence",
      -            "basePoints",
      -            "points"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "escalationBonus": {
      -        "type": "number"
      -      },
      -      "escalationReasons": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "highSeverityPoints": {
      -        "type": "number"
      -      },
      -      "levelBands": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "critical": {
      -            "type": "string"
      -          },
      -          "high": {
      -            "type": "string"
      -          },
      -          "low": {
      -            "type": "string"
      -          },
      -          "medium": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "low",
      -          "medium",
      -          "high",
      -          "critical"
      -        ],
      -        "type": "object"
      -      },
      -      "lowSeverityPoints": {
      -        "type": "number"
      -      },
      -      "mediumSeverityPoints": {
      -        "type": "number"
      -      },
      -      "model": {
      -        "type": "string"
      -      },
      -      "rawScore": {
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "model",
      -      "components",
      -      "lowSeverityPoints",
      -      "mediumSeverityPoints",
      -      "highSeverityPoints",
      -      "escalationBonus",
      -      "escalationReasons",
      -      "cappedBySeverity",
      -      "rawScore",
      -      "levelBands"
      -    ],
      -    "type": "object"
      -  },
      -  "summary": {
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "riskScore",
      -  "riskLevel",
      -  "decision",
      -  "anomalyCount",
      -  "anomalies",
      -  "financialChecks",
      -  "recommendedAction",
      -  "summary",
      -  "mode",
      -  "contextUsed",
      -  "invoiceSummary",
      -  "dataCompleteness",
      -  "scoring",
      -  "limitations",
      -  "asOfDate",
      -  "checkedAt"
      -]
  5. Added

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, so the safety profile is covered. The description adds value beyond that: output shape (0–100 risk score, risk level, advisory decision continue/review/hold, machine-readable anomaly codes with severity/confidence/evidence), the deterministic decimal-safe guarantee, and the pricing/payment model (x402, unpaid calls return payment instructions, $0.25/call). It omits rate limits and exact latency, which keeps it below 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and output contract, then usage, selection, exclusions, pricing. It is longer than strictly necessary, and the pricing/payment paragraph sits alongside the functional content, but every sentence informs an agent decision. Minor structural clutter (input-schema note) prevents a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (8 top-level params, nested objects, output schema present), the description covers what the tool does, when to use it, what it returns at a high level, its deterministic/country/currency scope, and the payment/preview flow. Since an output schema exists, it does not need to enumerate return fields, and it correctly doesn't. Nothing needed to invoke correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 75% and nested, so the schema carries most of the burden; the description still adds meaning by naming the optional context inputs (historical invoices, supplier profile, PO, contract, approval threshold, payment history) and clarifying standalone vs. context-aware modes. It does not explain the options block (asOfDate, duplicateWindowDays, minHistoryForPatterns), which the schema covers, so this is a solid 4 rather than 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verbs (detect, returns) and names the exact resource (duplicate, inconsistent, unusual, or fraudulent invoices) plus the check types (arithmetic, supplier-history, PO, payment-detail). It also explicitly distinguishes itself from siblings by naming company_due_diligence-adjacent exclusion: 'Do not use for company-level due diligence or extracting arbitrary document facts', separating it from analyze_company_risk and document_facts_extract.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides an explicit 'When' section (before approving, paying, booking, reconciling, auditing) and a 'Selection' note ('primary; prefer for invoice review before payment or duplicate and arithmetic checks'), plus explicit exclusions ('Do not use for company-level due diligence or extracting arbitrary document facts'). The preview_capability mention further routes the agent before a paid call.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.