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

TableJSON 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

TableJSON 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. 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"
      -]
  3. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.