Skip to main content
Glama

Agentic Fabrication Network (AFN)

Read a cart

get_cart

Read a cart: every part with its quote, the rules on it (constraints_asked), its pick (selection) and what the pick comes to — the shop, the price, the shipping speed and the arrival date — plus whether that option can be ordered right now (checkout.state: "ready"; "needs_check" = the shop has to confirm it first; "checking" = the shop is answering, read again shortly; "not_orderable" = pick another option; checkout.reason says why in a sentence and checkout.code says it as one word — on a "needs_check" part, "confirmation_lapsed" or "never_confirmed" mean reconfirm true will ask its one shop (and so will checkout_cart, by itself), "ask_limited" means the option is chosen and its shop is asked when the user pays, while "rechecking" (the part was copied from a shared cart and its shops are still being asked: read the cart again) and "shop_asks_off" (the network is not asking shops for this part right now) mean reconfirm true will start nothing for it). now is the network's own clock when the answer was made: work out the time left until checkout.confirmed_until from now, not from your own clock. by_shop groups the picked parts by the shop that makes them with subtotals and shipping, and total_cents is what the picked parts cost together. Parts with nothing picked are listed in unpicked_item_ids and are in no total. A plain read asks no shop. Pass reopen true when the user comes back to a cart: parts older than 24 hours are then asked about again, once, one part at a time (the answer's reopen says "asked", "none_needed", or "press_needed" — the old parts were already asked about again once and nothing was done to the cart since; pass pressed true only when the user asks for today's prices). picked.stale, picked.answered_at, picked.eta_days and picked.eta_approximate read as they do on an offer: when eta_approximate is true say "about N days", never the date. HOW LONG A PRICE HOLDS: a shop's confirmation of a picked option is good for 15 minutes. While it stands the part reads "ready" and checkout.confirmed_until says until when — tell the user the time they have. After it the part is NOT lost: it keeps its pick and its price and reads "needs_check" again. It is confirmed again by its one shop (nobody else is asked) when its option is chosen, and by checkout_cart itself when the user pays; reconfirm true on get_cart starts the same asks ahead of time — read the cart again and "ready" means the price stands. checkout.code "ask_limited" means the option is chosen and its shop will be asked when the user pays. When a part carries price_changed, the shop's answer moved the price or the arrival (direction "up", "down", or "same" when only the arrival moved) — tell the user the old and the new figure before they pay. checkout_cart stops ONCE by itself when the cart's total came back higher than the user agreed to (price_went_up). A part whose prices passed their 24-hour expiry is given a new quote by the read itself (quoted_anew true, price_source "instant"): it shows our instant prices again, its pick is kept, no shop was asked, and its shop confirms the pick when asked. SHIPPING IN A CART: by_shop[].shipping says how each shop's parts ship. mode "ships_separately" = each part is its own order with that shop and its own package, and pays its own shipping; mode "combined" = the shop takes those parts as ONE order and ships them together. Tell the user which it is, in the words of shipping.reason. Name a shipping saving ONLY when shipping.saved_cents is above zero, and only that amount — never promise or hint at a saving for buying several parts from one shop otherwise. When shipping.code is "speeds_differ", the parts of that shop are picked at different shipping speeds; you may tell the user that the shop sends parts together only at one speed, and read the cart again after they change a pick — do not state what it would save before the cart shows it. A SHARED CART: status "shared" means the cart came by a link and can only be read and copied. Never change it, pick on its parts' quotes, run check_offer on them or check it out — each of those is refused (cart_shared). Copy it with fork_cart and work on the copy, which is the user's own cart. A COPIED CART: copied true is present on a cart that was copied from a shared one; a cart never says which cart it was copied from. Each part's price_source says whose prices it shows: "shared" = recent shop prices that were copied with nobody asked — the prices of the person who shared the cart as they stood when it was copied, or the shops' own answers to this same part and request from the last 24 hours; "instant" = our instant prices, because the shared prices could not be copied (they were too old, or still coming in) — no shop has been asked about that part on this quote yet; "own" = this cart's own quote of the part, its shops asked. A pick that travelled with the cart but matches no option now reads selection_match.status "none": that part is still to choose. The buyer, the address, the email and any coupon never travel with a cart. PARTS OLDER THAN 24 HOURS: a shop's answer is shown for 24 hours. A cart copied with fork_cart inside them asks nobody: every part comes with its answers as they stand. A part whose answers are OLDER than 24 hours shows our instant prices first, and (unless the copy was for_link or recheck false) its shops are then asked about it again, one part at a time. Each such part's recheck says where it stands: "queued" = priced, its shops are asked when its turn comes; "asking" = its shops are being asked now; "done" = the shops' answers are in. A part with no recheck is under 24 hours old and nothing is pending for it. A part's quote_id CHANGES when its turn comes, so read quote_id off get_cart every time and never keep an old one. Until every such part reads done, tell the user the prices and dates may still move, and read the cart again; do not start a second copy to hurry it. A picked part goes first and its picked option is confirmed with its shop as part of it. HOW A CART WORKS: each part in a cart IS a quote — its material, finish, quantity, rules and its pick (selection) live on that part's quote, and nothing is kept twice. To change a part, call refine_quote on its quote_id and pass cart_item_id: the cart follows the part to the new quote by itself. To pick the option to order for a part, store the pick on its quote (refine_quote selection). The cart_id is the only key to the cart — whoever holds it can read and change it — so give it only to the user it belongs to, and never put it in a link you did not get from the network.

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": {
      "cart_id": "<cart_id>"
    },
    "name": "get_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
reopenNotrue = the user came back to this cart: parts whose answers are older than 24 hours are asked about again, once, one part at a time (answers anyone got for the same part in the last 24 hours are copied first, and then nobody is asked). The only cart read that may ask every shop about a part. Leave it out for a plain look
cart_idYesThe cart to read (cart_…)
pressedNoWith reopen true: true = the user asked for today's prices. Needed only after an answer whose reopen read "press_needed"
reconfirmNotrue = also have each picked part that reads "needs_check" confirmed by its one shop (nobody else is asked). The answer comes back at once with those parts "checking" — read the cart again for the result. Use it when the user opens the cart to pay; leave it out for a plain look

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations, the description discloses extensive behavior: a plain read has no shop side effects, reopen and reconfirm can trigger shop asks, prices hold for 15 minutes, stale parts may be rechecked, and shared carts are read-only and must be copied. It also explains cart_id confidentiality and the consequences of 'needs_check' states, which is far richer than the structured annotations alone.

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?

The description is extremely long and dense, with many nested parentheticals and repeated explanations of price holds, shared-cart restrictions and recheck behavior. It is front-loaded with the core read purpose and uses some all-caps section labels, but the overall structure is a wall of text that is hard to scan and would benefit from substantial trimming.

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?

There is no output schema, so the description must carry the burden of explaining return fields and states; it does so comprehensively, covering checkout.state, checkout.code, by_shop, totals, unpicked items, shipping modes, copied/shared cart behavior and stale-price handling. For a tool of this complexity, the definition is unusually complete.

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%, and the schema already documents reopen, pressed, reconfirm and cart_id in detail. The description adds behavioral context around those modes, but much of its parameter-specific prose duplicates the schema rather than adding new syntax or constraints, so the baseline of 3 is appropriate.

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 specific verb and resource: 'Read a cart', then enumerates exactly what is returned: parts, quotes, rules, selections, checkout state, pricing, shipping and totals. It also distinguishes this read operation from checkout_cart, fork_cart, refine_quote and check_offer, so an agent can identify its role without opening other schemas.

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 explicit when-to-use guidance for the optional modes: a plain read asks no shop, reopen true is for a returning user, pressed true is only after 'press_needed', and reconfirm true is for opening a cart to pay. It also names alternatives and prohibitions, including using fork_cart for shared carts and refine_quote to change a part.

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