Skip to main content
Glama

prepare_checkout

Read-onlyIdempotent

Build the buyer’s checkout link with optional prefill of the name, phone, email and address the buyer gave you. Use it only when the buyer asks for prefill and understands that anyone with the link can read the details. By default, give the buyer the checkoutUrl from quote_basket so they can enter their contact details on the website. The server does not store or log buyer details: they exist only inside the returned link, which is not encrypted, so share it only with the buyer. Creates NO order. The buyer opens the link, reviews or corrects details, accepts terms and personally confirms. Card payment link follows by WhatsApp. A basket with blockers is refused with the same blockers and amounts quote_basket reports. Both basket tools (quote_basket, prepare_checkout): Required on every call: country (AE), emirate (buyer-selected destination) and items (the complete basket). Each item requires id and qty. Ask the buyer for any missing destination or quantity before calling; use search_products to resolve exact orderable product IDs. Never guess missing values. For Research Use Only. This research-use-only catalogue is for buyers 21+ years of age and is supplied for research purposes only. Not for human or veterinary use. Reading replies: a refusal has isError true with error, message, field and nextAction (plus blockers, unavailableItems or remainingItems when they apply). A priced basket that cannot be ordered yet is not an error: it has readyForReview false and a blockers list with the amounts and a nextAction. catalogExpiresAt is this server’s cache clock, not a deadline: a checkout link does not expire and the order page rechecks stock and prices when the buyer opens it. Send these fields inside tools/call params.arguments. Both basket tools are stateless: send the complete basket again, combining duplicate IDs. Do not send prices, totals, consent or approval flags. For INVALID_ARGUMENTS, check missingFields and invalidFields when present. Follow nextAction and resend the complete corrected basket. Dubai and qty 1 are examples, not defaults; replace them with the buyer-selected emirate and quantity, and replace PRODUCT_ID_FROM_SEARCH with an orderable id from search. No cart, session or quote ID is accepted. Buyer prefill is optional and must be nested inside buyer. Example arguments: {"country":"AE","emirate":"Dubai","items":[{"id":"PRODUCT_ID_FROM_SEARCH","qty":1}]}

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": {
      "country": "<country>",
      "emirate": "<emirate>",
      "items": "<items>"
    },
    "name": "prepare_checkout"
  }
}

Input Schema

NameRequiredDescriptionDefault
buyerNoOptional buyer-supplied prefill, accepted only by prepare_checkout. Omit if not supplied. No payment, consent or approval fields. The server does not store or log these details; they exist only inside the returned link, which is not encrypted, so share it only with the buyer.
itemsYesRequired COMPLETE desired basket of 1–20 distinct variant IDs. Combine the same ID into one line; send the entire updated basket on every call.
countryYesRequired delivery country code: AE means United Arab Emirates.
emirateYesRequired buyer-selected destination. Use an exact listed emirate; ask the buyer if unknown, never assume Dubai.
promoCodeNoOptional buyer-supplied promotion code, up to 24 letters or digits. Omit when absent; do not invent one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / buyer / description
      Previous value: -"Optional buyer-supplied prefill, accepted only by prepare_checkout. Omit if not supplied. No payment, consent or approval fields. The resulting link contains these details and is not encrypted; share only with the buyer."New value: +"Optional buyer-supplied prefill, accepted only by prepare_checkout. Omit if not supplied. No payment, consent or approval fields. The server does not store or log these details; they exist only inside the returned link, which is not encrypted, so share it only with the buyer."
  2. Changed3 schema fields changed
    • changedInput schema / properties / items / description
      Previous value: -"The COMPLETE desired basket of 1–20 distinct variant IDs. Combine the same ID into one line; send the entire updated basket on every call."New value: +"Required COMPLETE desired basket of 1–20 distinct variant IDs. Combine the same ID into one line; send the entire updated basket on every call."
    • changedInput schema / properties / items / items / properties / id / description
      Previous value: -"Exact id from the latest search_products result, not sku, product name or URL. Select an orderable variant."New value: +"Required exact id from the latest search_products result, not sku, product name or URL. Select an orderable variant."
    • changedInput schema / properties / items / items / properties / qty / description
      Previous value: -"Quantity as a JSON integer from 1 to 10, for example 2, not \"2\". The field is qty, not quantity."New value: +"Required buyer-selected quantity as a JSON integer from 1 to 10, for example 2, not \"2\". The field is qty, not quantity. Ask the buyer if unknown; there is no default quantity."
  3. Changed11 schema fields changed
    • addedInput schema / properties / buyer / description
      Added value: +"Optional buyer-supplied prefill, accepted only by prepare_checkout. Omit if not supplied. No payment, consent or approval fields. The resulting link contains these details and is not encrypted; share only with the buyer."
    • addedInput schema / properties / buyer / properties / address / description
      Added value: +"Optional buyer-supplied address, up to 500 characters; do not invent missing delivery details."
    • addedInput schema / properties / buyer / properties / email / description
      Added value: +"Optional buyer-supplied email, up to 254 characters; use the supplied value as-is."
    • addedInput schema / properties / buyer / properties / name / description
      Added value: +"Optional buyer-supplied name, up to 120 characters; do not infer or invent it."
    • addedInput schema / properties / buyer / properties / phone / description
      Added value: +"Optional buyer-supplied phone, up to 40 characters; use the supplied value as-is."
    • addedInput schema / properties / country / description
      Added value: +"Required delivery country code: AE means United Arab Emirates."
    • addedInput schema / properties / emirate / description
      Added value: +"Required buyer-selected destination. Use an exact listed emirate; ask the buyer if unknown, never assume Dubai."
    • addedInput schema / properties / items / description
      Added value: +"The COMPLETE desired basket of 1–20 distinct variant IDs. Combine the same ID into one line; send the entire updated basket on every call."
    • addedInput schema / properties / items / items / properties / id / description
      Added value: +"Exact id from the latest search_products result, not sku, product name or URL. Select an orderable variant."
    • addedInput schema / properties / items / items / properties / qty / description
      Added value: +"Quantity as a JSON integer from 1 to 10, for example 2, not \"2\". The field is qty, not quantity."
    • addedInput schema / properties / promoCode / description
      Added value: +"Optional buyer-supplied promotion code, up to 24 letters or digits. Omit when absent; do not invent one."
  4. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive/non-open-world, and the description is consistent with them ("Creates NO order"). Beyond the annotations it adds real behavior: details are neither stored nor logged but live in an unencrypted link, blocked baskets are refused with the same blockers quote_basket reports, readyForReview=false plus a blockers list is not an error, and catalogExpiresAt is a cache clock rather than an expiry. The main thing it does not spell out is the shape of a successful link-bearing response, though it does point to checkoutUrl.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded well — the purpose and the prefill caution come first — but the body is a very long block that mixes this tool's behavior with rules explicitly addressed to "Both basket tools," plus regulatory boilerplate (Research Use Only, 21+, not for human or veterinary use) and an inline example. Much of this repeats schema text, and the shared-tool sections dilute the parts specific to prepare_checkout.

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 nested, 5-parameter, no-output-schema tool with a stateless contract, the description covers what an agent needs: required fields, refusal vs. priced-but-blocked distinction, error field set (isError, message, field, nextAction, blockers/unavailableItems/remainingItems), INVALID_ARGUMENTS handling via missingFields and invalidFields, and the fact that payment follows separately by WhatsApp. Nothing material for correct invocation is missing.

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; the description earns above that by adding cross-cutting rules the schema cannot express: prefill "must be nested inside buyer," the call is stateless so the complete basket must be resent with duplicate IDs combined, and "Do not send prices, totals, consent or approval flags" / "No cart, session or quote ID is accepted." It also flags that Dubai and qty 1 are examples rather than defaults and that PRODUCT_ID_FROM_SEARCH must be replaced with an orderable id from search_products.

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 opens with a concrete verb+resource: "Build the buyer's checkout link with optional prefill of the name, phone, email and address." It also states the scope boundary against the sibling ("By default, give the buyer the checkoutUrl from quote_basket") and explicitly says "Creates NO order," so an agent can distinguish it from quote_basket and search_products without opening a 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?

It gives an explicit when-to-use condition ("Use it only when the buyer asks for prefill and understands that anyone with the link can read the details") and an explicit default path ("By default, give the buyer the checkoutUrl from quote_basket"), naming the alternative and the condition that selects it.

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