Skip to main content
Glama

buy_with_saved_card

Shop and pay with the holder's saved card

Buys from online merchants (Amazon, Walmart, Target, Best Buy, DoorDash and more) and pays with the card the account holder saved themselves (see GET /get-saved-cards). One conversation per purchase:

  1. Send what to buy as ask, in plain language. Pass delivery_address on this first call when you know it.

  2. Relay reply to the holder and send their answers back as ask with the same conversation_id, until a cart comes back.

  3. Show the holder the cart. Once they agree, send its hash as confirm with the conversation_id. Nothing can be charged before this.

  4. The confirm answers awaiting_approval with an approval_url. Send it to your human; never open it yourself. They approve on their own device with their passkey. Then send the same confirm again to get order_placed.

A turn runs against a live merchant and can take up to two minutes. This call waits about 45 seconds: a turn that finishes in time comes back complete (state: done); a slower one comes back as state: running with a turn_id to poll with GET /get-purchase-turn.

This route is free. The holder's own card pays the merchant, and no identity verification is needed.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "buy_with_saved_card"
  }
}

Input Schema

NameRequiredDescriptionDefault
askNoWhat the holder wants, in plain language. Required unless confirming.
confirmNoA cart's `hash` from an earlier turn, to place exactly that cart.
conversation_idNoThe conversation to continue. Required with `confirm`.
delivery_addressNoWhere to ship. Send it on the call that asks for the cart (a cart is bound to the address it was shown for) and on the confirm.

Output Schema

NameRequiredDescriptionDefault
cartNoThe most recently shown cart.
noteNoThe next step.
cartsNoEvery open cart in the conversation, oldest first.
errorNoPresent when `state` is `failed`.
replyNoThe shopping assistant's turn as prose, ready to show the holder.
stateNo`running` means the turn is still talking to the merchant; the fields below appear once it is `done`. One of: running, done, failed.
statusNoWhat to do next. `needs_input`: a question or a cart waiting on a confirm. `awaiting_approval`: send `approval_url` to the holder, then repeat the same confirm. `in_progress`: the order is already being placed; read `GET /get-purchase-conversation` instead of confirming again. `order_placed`. `declined`: see `decline_code`. `conflict`: nothing ran, see `error_code` and confirm the fresh cart's hash. Never branch on `reply`. One of: needs_input, awaiting_approval, in_progress, order_placed, declined, conflict.
catalogNoThe last product search. Empty on a turn that did not search again, so keep the previous one.
turn_idNoThis turn's id. Poll `GET /get-purchase-turn` with it while `state` is `running`.
order_idNoSet when this turn placed an order.
unmatchedNoThings asked for that did not make it into a cart, with a reason. Show these rather than guessing from `reply`.
card_last4NoThe saved card that paid, for naming it to the holder.
created_atNoMilliseconds since the epoch.
error_codeNoOn `conflict`: `cart_changed`, `turn_in_progress`, `delivery_address_changed`, or `delivery_address_bound_after_cart`.
approval_urlNoSend to the holder when `status` is `awaiting_approval`. Never open it yourself.
decline_codeNoThe machine reason behind `declined`, e.g. `items_unavailable`.
charge_statusNoWhether money moved: `none`, `confirming`, `settled`, or `unknown` (do not retry; read the conversation). One of: none, confirming, settled, unknown, .
conversation_idNoSend it back on every follow-up and on the confirm.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover the safety profile (non-read-only, non-idempotent, non-destructive); the description supplies the behavior that actually matters: the human approval gate via approval_url that the agent must never open, the ~45s wait versus a potential two-minute live turn with state: done/running plus turn_id polling, and that the route is free with no identity verification. This is behavior beyond what structured fields convey.

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?

Front-loaded with the purpose, then a numbered flow, then timing behavior; nearly every sentence carries operational weight. It is longer than strictly minimal, but the density of actionable detail (approval routing, poll fallback, free/no-KYC note) justifies most of the length.

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

Completeness5/5

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

For a multi-turn live-merchant purchase flow with nested address input and an output schema, the description covers the conversation lifecycle, the approval gate, and the async return states, so an agent knows what to expect at each call and how to resume.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds real semantics: which parameter to send on which turn, that delivery_address should go on both the cart-requesting call and the confirm, and that the cart is bound to the address it was shown for. It does not restate the hash pattern or field formats, which the schema already covers.

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?

States a specific verb and resource ('Buys from online merchants ... and pays with the card the account holder saved'), names concrete merchants, and distinguishes itself from siblings like order_gift_card, order_intl_card, and send_payment by tying the payment to the holder's saved card. An agent can route to it without opening the schema.

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

Usage Guidelines5/5

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

Gives an explicit four-step when-and-how sequence, names the sibling route for prerequisites (GET /get-saved-cards) and the polling alternative (GET /get-purchase-turn), and states the precondition that nothing can be charged before confirm. Exclusions and conditions are all spelled out.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources