optimize_purchase
Ranks the user's cards by rewards and applicable unused statement credits before payment, then flags required conditions, payment-rail risks, and expiring credits to guide which card to charge.
Instructions
The step before you pay: call BEFORE paying for anything. Given the merchant, category and amount, ranks the user's cards by rewards earned (rates from CardSavvy's catalog) plus any statement credit that applies and hasn't been used this period, returns the conditions to check first (enrollment, activation, booking channel), the risks of the payment method, and credits and balances expiring within 14 days. Recommend the best card, relay the warnings, and ask the user the questions in ask_user (one at a time), saving answers with the set_/mark_ tools.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"merchant": "<merchant>",
"category": "<category>",
"amount": "<amount>"
},
"name": "optimize_purchase"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | ISO date of the purchase; defaults to today. | |
| rail | No | staged_virtual_card = paying with a wallet's one-time card (e.g. Link) instead of the card itself. | |
| amount | Yes | Purchase total in USD. | |
| category | Yes | What is being bought. | |
| merchant | Yes | Merchant or brand being paid, e.g. 'Delta Stays', 'Uber', 'lululemon'. | |
| booked_via | No | issuer_portal = booked through the card issuer's travel site. |