Skip to main content
Glama

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

NameRequiredDescriptionDefault
dateNoISO date of the purchase; defaults to today.
railNostaged_virtual_card = paying with a wallet's one-time card (e.g. Link) instead of the card itself.
amountYesPurchase total in USD.
categoryYesWhat is being bought.
merchantYesMerchant or brand being paid, e.g. 'Delta Stays', 'Uber', 'lululemon'.
booked_viaNoissuer_portal = booked through the card issuer's travel site.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it enumerates what the result contains (ranked rewards rates, unused statement credits, enrollment/activation/booking-channel conditions, payment-method risks, 14-day expirations) and implies it is advisory by deferring writes to set_/mark_ tools. It never explicitly says the call is side-effect-free, nor does it state prerequisites such as cards needing to be loaded first, nor rate-limit or auth behavior.

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 paragraph is front-loaded with the critical timing instruction and every clause about outputs carries information. It is somewhat overloaded, mixing tool behavior with agent workflow directives ('Recommend the best card, relay the warnings, ask one at a time') and mentioning an ask_user artifact that is not a listed sibling, which adds mild ambiguity.

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

Completeness4/5

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

For a six-parameter tool with no output schema, the description does a good job describing what comes back, so an agent knows how to use the result. Gaps remain around prerequisites (must the user's cards be loaded via set_my_cards first?) and confirmation that the call itself mutates nothing, which matters on a financial-advice path.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents all six parameters including the rail and booked_via enums. The description only echoes the three required fields and adds no interpretation of how date, rail or booked_via change the ranking. Baseline 3 is appropriate when the schema does the heavy lifting.

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 states a specific function: given merchant, category and amount it ranks the user's cards by rewards plus applicable statement credits and returns conditions, risks and expiring credits/balances. This is clearly distinguishable from siblings like list_cards, whats_expiring or mark_credit, which each do one narrow piece of that job.

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

Usage Guidelines4/5

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

'The step before you pay: call BEFORE paying for anything' gives an explicit trigger condition and ordering relative to payment. It also names the follow-up tools (set_/mark_) that consume the answers. It stops short of stating any when-not-to-use case or what to do if no cards are on file.

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