Skip to main content
Glama

Prepare payment

checkout_prepare_payment
Idempotent

Create a short-lived server confirmation bound to the exact selected cart lines, cart revision, address, shipping option, and currency. Server checks the supplied cartRevision and selectedLines against the live cart, then returns the current quote cartRevision, confirmationId, expiresAt, totalAmountMinor, currencyCode, quote, and selectedShippingOption. Creates no order or charge at this stage. Requires checkout:write scope. After checkout_quote, prepare this confirmation, ask the user to review the returned total and shipping option, then use checkout_create_payment_link only after approval. Pass the selectedLines again with the returned global cartRevision to prepare payment. At payment-link creation, the confirmation is bound to one idempotencyKey: retries must use that same key, and another key is rejected. If the cart changes, payment creation is blocked and checkout must be prepared again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressIdYesUUID of the selected shipping address.
promoCodeNoOptional promotional or coupon code. Validity confirmed at quote time.
useCreditsNoApply available account credits toward the total.
countryCodeYesISO 3166-1 alpha-2 market country code. Choose from market_list output.
cartRevisionYesThe global cart revision returned by cart_get.
currencyCodeYesISO 4217 alpha-3 market currency code. Choose from market_list output.
languageCodeYesLowercase ISO 639-1 language code. Choose from market_list output.
selectedLinesYesThe exact cart lines to check out. Copy itemId, configurationId when present, and wholesale from cart_get. Unlisted cart lines stay in the cart.
shippingOptionIdYesSelected shipping option ID from checkout_quote response. Must match shippingOptions[].id exactly.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / cartRevision
      Added value: +{
      +  "description": "The global cart revision returned by cart_get.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / selectedLines
      Added value: +{
      +  "description": "The exact cart lines to check out. Copy itemId, configurationId when present, and wholesale from cart_get. Unlisted cart lines stay in the cart.",
      +  "items": {
      +    "properties": {
      +      "configurationId": {
      +        "pattern": "^[A-Za-z0-9._:-]{1,128}$",
      +        "type": "string"
      +      },
      +      "itemId": {
      +        "description": "An itemId copied from one selected line in cart_get.",
      +        "pattern": "^[A-Za-z0-9._:-]{1,128}$",
      +        "type": "string"
      +      },
      +      "wholesale": {
      +        "description": "The exact wholesale value copied from that cart_get line.",
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "itemId",
      +      "wholesale"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 50,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "countryCode",
      -  "currencyCode",
      -  "languageCode",
      -  "addressId",
      -  "shippingOptionId"
      -]New value: +[
      +  "countryCode",
      +  "currencyCode",
      +  "languageCode",
      +  "addressId",
      +  "cartRevision",
      +  "selectedLines",
      +  "shippingOptionId"
      +]
  2. Changed7 schema fields changed
    • addedInput schema / properties / addressId / description
      Added value: +"UUID of the selected shipping address."
    • addedInput schema / properties / countryCode / description
      Added value: +"ISO 3166-1 alpha-2 market country code. Choose from market_list output."
    • addedInput schema / properties / currencyCode / description
      Added value: +"ISO 4217 alpha-3 market currency code. Choose from market_list output."
    • addedInput schema / properties / languageCode / description
      Added value: +"Lowercase ISO 639-1 language code. Choose from market_list output."
    • addedInput schema / properties / promoCode / description
      Added value: +"Optional promotional or coupon code. Validity confirmed at quote time."
    • addedInput schema / properties / shippingOptionId / description
      Added value: +"Selected shipping option ID from checkout_quote response. Must match shippingOptions[].id exactly."
    • addedInput schema / properties / useCredits / description
      Added value: +"Apply available account credits toward the total."
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (non-readOnly, idempotent, non-destructive), but the description adds real context: requires checkout:write scope, the confirmation is short-lived with an expiresAt, no order/charge is created, and the idempotencyKey binding rejects a different key on retry. This is substantial beyond-annotation detail, though return/pagination nuance is only lightly touched.

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 core action is front-loaded in the first sentence, with constraints and workflow following in logical order. It is dense and slightly run-on, but every sentence carries operational information rather than filler.

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?

With no output schema, the description enumerates the returned values (cartRevision, confirmationId, expiresAt, totalAmountMinor, currencyCode, quote, selectedShippingOption), so an agent knows what to expect. Combined with the workflow and error conditions, it is complete for a 9-parameter, 7-required mutation tool.

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 the baseline is 3, but the description adds meaning by explaining that selectedLines and cartRevision are validated against the live cart and must be passed again with the returned global cartRevision. It reinforces the binding of address, shipping option, and currency to the confirmation, going beyond field-level schema text.

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 ("Create a short-lived server confirmation bound to the exact selected cart lines...") and immediately scopes what it does not do ("Creates no order or charge at this stage"). It is clearly distinguishable from checkout_quote and checkout_create_payment_link, which are named directly.

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 ordered workflow: after checkout_quote, prepare this confirmation, have the user review the total/shipping, then call checkout_create_payment_link only after approval. It also states the blocking condition (cart changes) and the required retry behavior (same idempotencyKey).

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