check_payment_policy
Verifies a payment against configured spending limits and records the spend before submission. Call once immediately before paying to avoid inflating rolling spend windows.
Instructions
Check whether a payment is allowed by the configured spending policy.
WARNING: this records the spend against rolling time-window ledgers. Call exactly once, immediately before submitting the payment. If you call this and then do not pay, the spend window will be inflated until it rolls over.
Configure limits at server startup via PRESIDIO_X402_MCP_* env vars.
Args: resource_url: x402 resource URL being paid. Screened first; only the redacted URL reaches the policy engine (per-endpoint limits match on it, so keep PII out of configured endpoint prefixes). amount_usd: Payment amount in USD-equivalent. prior_decision_refs: Optional decision_ref values this server returned earlier for the same payment (e.g. from screen_payment_metadata); linked into the signed record. Max 8.
Returns: {"allowed": true} on success, or {"allowed": false, "reason": str, "limit_usd": float, "amount_usd": float}; plus decision_ref when signed decision evidence is enabled.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount_usd | Yes | ||
| resource_url | Yes | ||
| prior_decision_refs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||