Skip to main content
Glama

Agentic Fabrication Network (AFN)

Create checkout

create_checkout

Create checkout for one chosen offer and shipping speed. Hosted payment is the default. Call this after the user chooses the offer and shipping speed. This tool takes NO personal details: never ask for — and never pass — a name, address, email, or phone; the secure payment page collects the shipping address, email, and phone (and billing) itself, even when the user volunteered them in chat. In hosted-payment mode, returns checkout_url — the AFN's order page (what is being made, by which shop, the all-in price) with a Continue to payment button to the secure hosted payment page; give the link to the user. UFP places the vendor order automatically after payment. An offer whose shop still has to confirm it (manufacturability_check.status "unchecked", or confirmed more than 15 minutes ago) is confirmed by this call itself, and one whose status is "checking" is waited for (the price is set; the shop is confirming it can make the part as drawn) — no separate check_offer call. Pass max_total_cents: the price the user agreed to (the offer's subtotal_cents plus the chosen shipping cost_cents). THE CHECKOUT RULE, enforced by the network for every client: an offer can be ordered only when the shop's own system has accepted this part at this price — its manufacturability check has passed, the price is the shop's own number (price_basis "vendor_api"), and no price confirmation is outstanding. That acceptance is good for 15 minutes (the offer's confirmed_until). THE CHECKOUT CONFIRMS WHAT NEEDS CONFIRMING ITSELF: when the option's shop has not confirmed it, or did more than 15 minutes ago, the checkout asks that ONE shop (it joins the ask already running when choosing the option started one) and waits up to wait_s for the answer; when the wait runs out first the answer is offer_not_ready with retry_after_s — send the SAME call again, it joins the ask and nothing is asked twice. THE PAY RULE: when the confirmed total is at or below the amount the user agreed to, checkout uses the selected payment method (hosted payment by default, or the saved card when pay is saved on a keyed connection); a price the shop confirmed HIGHER than the user agreed to stops ONCE (price_went_up, with old_total_cents and new_total_cents) and nothing is created — tell the user both figures, then send the call again (with the new max_total_cents when you sent one); the new price stands for 15 minutes and no shop is asked again. A passed offer whose price_refresh is still "pending" is refused the same way (offer_not_ready, with retry_after_s): the shop is still confirming its price — re-read the quote and retry then. An offer whose check failed, whose price_refresh reads "failed", or whose fulfillment is "not_connected" cannot be ordered at all (offer_check_failed) — offer the user another option or re-quote. Nothing is charged on any refusal. An offer whose shop could not confirm the part — it declined the part, or did not answer within two minutes of being asked — leaves the quote: it is no longer listed in offers, and its id is refused the same way. If an offer you showed earlier is missing when you re-read the quote, tell the user plainly that the shop could not confirm the part, and carry on with the offers that are listed. ORDER BY THE PICK: instead of offer_id + shipping_option_id, pass quote_id with selection true to order the one option the quote's stored pick comes to (the quote's selection_match). It orders only when that reads status "one"; with none or several it is refused (selection_not_unique, saying how many matched) and nothing is created — say more in the pick with refine_quote selection, then call again. When the pick names a shipping speed the option does not show right now (selection_match.speed_fallback) it is refused too (selection_speed_unavailable): the cheapest speed is never ordered in its place — store the pick with a speed the option lists. An offer_id or shipping speed the quote's own rules keep off its board (the acceptable-materials list, within_days) is refused the same way: order what the quote lists now. So the whole of it is two calls: refine_quote with the pick (its one shop starts confirming), then create_checkout with quote_id and selection true — the selected checkout result, price_went_up once, or offer_not_ready (call again). The checkout rule above applies to the picked option exactly as to any other. TO PLACE EXACTLY ONE ORDER WITH NO MISTAKES: (1) on get_fabrication_quote list only that shop in vendors and state the pick in selection — the shop, plus the material, finish and shipping speed wanted; (2) read selection_match on the quote: status "one" means exactly one option answers the pick, "many" means say more in the pick (color, thickness, quantity), "none" means nothing on the quote answers it; (3) call create_checkout with quote_id and selection true — it orders that one option at the picked shipping speed, or refuses and creates nothing (selection_not_unique: the pick is not exactly one option; selection_speed_unavailable: the option does not show the picked speed now — an order never takes another speed in its place). It returns the selected checkout result: a hosted payment link by default, or the saved-card outcome when pay is saved on a keyed connection.

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": "create_checkout"
  }
}

Input Schema

NameRequiredDescriptionDefault
checkNoDefault true: when the option has not had its shop's manufacturability check yet ("unchecked"), or its shop confirmed it more than 15 minutes ago, this call asks that one shop and waits for its answer (wait_s), then goes on or refuses as the checkout rule says. false = ask nobody: such an option is refused at once (offer_not_ready). Usually OMIT
wait_sNoSeconds this call may wait for the shop (default 45). When it runs out first the answer is offer_not_ready — send the same call again
offer_idNoThe offer to order. Required unless selection is true
quote_idNoWith selection true: the quote whose picked option to order
selectionNotrue = order the quote's stored pick (its selection) instead of naming an offer: pass quote_id and leave offer_id and shipping_option_id out. Orders only when the quote's selection_match reads "one"; otherwise it is refused (selection_not_unique) and nothing is created; refused as well (selection_speed_unavailable) when the pick names a shipping speed that option does not show now
return_urlNoExact URL of the page the user is on right now, IF the client application knows it (a web app embedding this tool passes its own page URL). The post-payment page shows a 'Return to <site>' button pointing here. Omit when unknown — never invent one.
coupon_codeNoCoupon code, only if the user provided one (early-adopter codes from the AFN team). Case-insensitive. The discount appears on the payment page; a 100%-off code makes the total $0 with no card required. Never invent or guess a code.
max_total_centsNoThe most the user agreed to pay for this option at this shipping speed, in cents, before any coupon: the subtotal_cents plus the speed's cost_cents you showed them. At or under it the order is made; a higher confirmed price is refused once (price_went_up) and nothing is created. Leave it out and the network compares with the price it last told this quote's reader
shipping_option_idNoOne of the offer's shipping option ids. Required with offer_id; leave out with selection true

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / idempotency_key
      Removed value: -{
      -  "description": "Only with pay \"saved\": one unique string for THIS payment, made up by you (letters and digits, 8 or more). Send the same string only to repeat the very same call — it never charges twice",
      -  "maxLength": 200,
      -  "minLength": 8,
      -  "type": "string"
      -}
    • removedInput schema / properties / pay
      Removed value: -{
      -  "description": "\"saved\" = charge the card saved on your AFN key instead of returning a payment page. Needs that key on the connection, plus idempotency_key, the shipping address, the buyer's email and max_total_cents. Usually OMIT",
      -  "enum": [
      -    "saved"
      -  ],
      -  "type": "string"
      -}
  2. Changed10 schema fields changed
    • addedInput schema / properties / check
      Added value: +{
      +  "description": "Default true: when the option has not had its shop's manufacturability check yet (\"unchecked\"), or its shop confirmed it more than 15 minutes ago, this call asks that one shop and waits for its answer (wait_s), then goes on or refuses as the checkout rule says. false = ask nobody: such an option is refused at once (offer_not_ready). Usually OMIT",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / idempotency_key
      Added value: +{
      +  "description": "Only with pay \"saved\": one unique string for THIS payment, made up by you (letters and digits, 8 or more). Send the same string only to repeat the very same call — it never charges twice",
      +  "maxLength": 200,
      +  "minLength": 8,
      +  "type": "string"
      +}
    • addedInput schema / properties / max_total_cents
      Added value: +{
      +  "description": "The most the user agreed to pay for this option at this shipping speed, in cents, before any coupon: the subtotal_cents plus the speed's cost_cents you showed them. At or under it the order is made; a higher confirmed price is refused once (price_went_up) and nothing is created. Leave it out and the network compares with the price it last told this quote's reader",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offer_id / description
      Added value: +"The offer to order. Required unless selection is true"
    • addedInput schema / properties / pay
      Added value: +{
      +  "description": "\"saved\" = charge the card saved on your AFN key instead of returning a payment page. Needs that key on the connection, plus idempotency_key, the shipping address, the buyer's email and max_total_cents. Usually OMIT",
      +  "enum": [
      +    "saved"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / quote_id
      Added value: +{
      +  "description": "With selection true: the quote whose picked option to order",
      +  "type": "string"
      +}
    • addedInput schema / properties / selection
      Added value: +{
      +  "description": "true = order the quote's stored pick (its selection) instead of naming an offer: pass quote_id and leave offer_id and shipping_option_id out. Orders only when the quote's selection_match reads \"one\"; otherwise it is refused (selection_not_unique) and nothing is created; refused as well (selection_speed_unavailable) when the pick names a shipping speed that option does not show now",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / shipping_option_id / description
      Previous value: -"One of the offer's shipping option ids"New value: +"One of the offer's shipping option ids. Required with offer_id; leave out with selection true"
    • addedInput schema / properties / wait_s
      Added value: +{
      +  "description": "Seconds this call may wait for the shop (default 45). When it runs out first the answer is offer_not_ready — send the same call again",
      +  "maximum": 120,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "offer_id",
      -  "shipping_option_id"
      -]
  3. Changed1 schema field changed
    • removedInput schema / properties / return_url / format
      Removed value: -"uri"
  4. Changed14 schema fields changed
    • removedInput schema / properties / billing_city
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / billing_name
      Removed value: -{
      -  "description": "Billing address, only when the buyer answered the billing question (e.g. said it differs from shipping, or a checkout UI's 'same as shipping' checkbox — then send the shipping values verbatim). Never ask for it; omit and the payment page handles billing.",
      -  "type": "string"
      -}
    • removedInput schema / properties / billing_state
      Removed value: -{
      -  "description": "Two-letter US state",
      -  "maxLength": 2,
      -  "minLength": 2,
      -  "type": "string"
      -}
    • removedInput schema / properties / billing_street1
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / billing_street2
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / billing_zip
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / city
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / email
      Removed value: -{
      -  "description": "Buyer email (only if the user provided it)",
      -  "format": "email",
      -  "type": "string"
      -}
    • removedInput schema / properties / name
      Removed value: -{
      -  "description": "Recipient full name (only if the user provided it)",
      -  "type": "string"
      -}
    • removedInput schema / properties / phone
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / state
      Removed value: -{
      -  "description": "Two-letter US state",
      -  "maxLength": 2,
      -  "minLength": 2,
      -  "type": "string"
      -}
    • removedInput schema / properties / street1
      Removed value: -{
      -  "description": "Street address (only if the user provided it)",
      -  "type": "string"
      -}
    • removedInput schema / properties / street2
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / zip
      Removed value: -{
      -  "type": "string"
      -}
  5. Changed1 schema field changed
    • addedInput schema / properties / coupon_code
      Added value: +{
      +  "description": "Coupon code, only if the user provided one (early-adopter codes from the AFN team). Case-insensitive. The discount appears on the payment page; a 100%-off code makes the total $0 with no card required. Never invent or guess a code.",
      +  "type": "string"
      +}
  6. Changed6 schema fields changed
    • addedInput schema / properties / billing_city
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / billing_name
      Added value: +{
      +  "description": "Billing address, only when the buyer answered the billing question (e.g. said it differs from shipping, or a checkout UI's 'same as shipping' checkbox — then send the shipping values verbatim). Never ask for it; omit and the payment page handles billing.",
      +  "type": "string"
      +}
    • addedInput schema / properties / billing_state
      Added value: +{
      +  "description": "Two-letter US state",
      +  "maxLength": 2,
      +  "minLength": 2,
      +  "type": "string"
      +}
    • addedInput schema / properties / billing_street1
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / billing_street2
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / billing_zip
      Added value: +{
      +  "type": "string"
      +}
  7. Changed1 schema field changed
    • addedInput schema / properties / return_url
      Added value: +{
      +  "description": "Exact URL of the page the user is on right now, IF the client application knows it (a web app embedding this tool passes its own page URL). The post-payment page shows a 'Return to <site>' button pointing here. Omit when unknown — never invent one.",
      +  "format": "uri",
      +  "type": "string"
      +}
  8. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only say non-readonly, open-world, non-destructive; the description adds substantial context beyond that: hosted payment is default, checkout_url is returned, refusals charge nothing, price_went_up fires once, offer_not_ready requires resending the identical call, and the 15-minute acceptance window. Slightly over-long and repetitive, but the behavioral disclosure is genuinely additive.

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

Conciseness2/5

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

Front-loaded and header-organized, but very long and heavily redundant: the checkout rule, the 15-minute confirmation window, and the quote_id+selection two-call procedure are each stated two or three times, and CAPS emphasis crowds out scanning. Several sentences could be deleted without losing information an agent needs.

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 9-parameter mutating tool with no output schema and many refusal modes (price_went_up, offer_not_ready, offer_check_failed, selection_not_unique, selection_speed_unavailable), the description covers return values, retry semantics, and what to tell the user in each case. Nothing an agent needs to call it correctly is missing.

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 description coverage is 100%, so the schema already documents offer_id, quote_id, selection, wait_s, check, return_url, coupon_code, max_total_cents and shipping_option_id. The description adds context on max_total_cents (subtotal + shipping cost) and the selection flow, but restates far more than it adds and never touches check, wait_s, return_url, or coupon_code.

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?

Opens with a specific verb+resource+scope: "Create checkout for one chosen offer and shipping speed," then immediately clarifies it does not perform the shop check itself ("no separate check_offer call"), distinguishing it from sibling check_offer and refine_quote.

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?

Explicit when-to-use ("Call this after the user chooses the offer and shipping speed"), an explicit two-call workflow with refine_quote, and explicit when-not (do not call check_offer first, do not collect personal details). Alternatives to use on failure (offer another option or re-quote) are named.

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