check_payment_policy
Check if a payment is allowed by spending policy, recording spend against rolling time-window ledgers. Call before submitting payment to enforce limits.
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 (used for per-endpoint limits). amount_usd: Payment amount in USD-equivalent.
Returns: {"allowed": true} on success, or {"allowed": false, "reason": str, "limit_usd": float, "amount_usd": float}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount_usd | Yes | ||
| resource_url | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||