Skip to main content
Glama

Agentic Fabrication Network (AFN)

Copy a shared cart

fork_cart

Copy a cart: the same parts in the same order, each configured and picked as it was (a copy made for a link keeps a part's pick only when it was stored with confirmed: true). Use it when the user opens a shared cart, so that nothing they change reaches the cart it was copied from; work on the cart_id this returns from then on. By default the copy is a NEW cart; pass into_cart_id (an open cart the user already holds) to add the copied parts to that cart instead — one call, and that cart is the answer. Use it with for_link true when the user wants to share their own cart: the copy is then a shared cart (status "shared") that can only be read and copied, and its cart_id is the one to hand out — never hand out the cart_id of the cart the user is working on. Pass item_ids to copy only those parts (one part shared by itself is a cart of one). Each part of the answer says quoted_anew: true when a new quote was made for it, false when the shared quote was copied. WHAT EACH WAY COSTS IN SHOP CONTACT: no shop is asked to make any copy, and the answer comes back at once with every part priced. A for_link copy never contacts a shop, then or later. A copy with recheck false never contacts a shop either — use it when you only want to read what is in a shared cart. Any other copy (the default, for a user who opened a shared cart to act on it) asks nobody when the cart's answers are under 24 hours old: each part comes with its shops' answers as they stand. Only a part whose answers are older than 24 hours is asked about again after the copy answers — its shops, as an ordinary quote of that part would ask them, one part at a time — and if anyone got answers for this same part and request in the last 24 hours those are copied instead with nobody asked. Never copy the same cart twice to refresh it — read the copy you have. LIMITS: copies are limited per caller a minute and a day, and the quotes the re-check will really start count against the caller's quote limit (a part whose shops are already being asked, or are queued to be asked, for another copy of the same request starts none); when you act for a person and say so (on_behalf_of), that person has their own counts of copies and of re-check quotes, a minute and a day; over a limit the answer is rate_limited with the seconds to wait, nothing is made and no shop is asked — wait, do not retry at once. A cart id that matches no cart answers "unknown cart" and nothing else. When it is the into_cart_id cart that is not known, the answer is an error with error "into_cart_unknown": nothing was copied — copy again without into_cart_id to get a new cart. 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": "fork_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
cart_idYesThe shared cart to copy (cart_…)
recheckNofalse = contact no shop at all: the copy keeps the prices it was given (use it to read a shared cart). Omit (the default): a part whose answers are under 24 hours old is copied with them and nobody is asked; a part older than that is asked about again after the copy answers, one part at a time. Never true together with for_link
for_linkNotrue = make the copy a shared cart, to hand out in a link: it can be read and copied, never changed or checked out, and it never contacts a shop. A part's pick travels in a link only when it was stored with confirmed: true (the user chose it, not just looked at it); any other pick is left out of the copy. Omit when the user is opening a cart someone shared
item_idsNoCopy only these parts — their item_id values from the shared cart. Omit to copy every part
into_cart_idNoAn OPEN cart the user already holds (cart_…): the copied parts are added to it, after its own parts, and that cart is returned. Refused, with nothing copied, when the cart would hold more than 24 parts or is shared or ordered. Omit to get a new cart. Never together with for_link
on_behalf_ofNoFor a client that serves many people from one place: its own opaque id for the person it is acting for (never a name or an email), so that person gets a copy limit of their own. Omit otherwise

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / for_link / description
      Previous value: -"true = make the copy a shared cart, to hand out in a link: it can be read and copied, never changed or checked out, and it never contacts a shop. Omit when the user is opening a cart someone shared"New value: +"true = make the copy a shared cart, to hand out in a link: it can be read and copied, never changed or checked out, and it never contacts a shop. A part's pick travels in a link only when it was stored with confirmed: true (the user chose it, not just looked at it); any other pick is left out of the copy. Omit when the user is opening a cart someone shared"
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say readOnly=false, destructive=false, openWorld=true; the description adds the cost model (which copy variants contact shops and when), the 24-hour answer window, per-caller and per-person rate limits with the rate_limited response and "wait, do not retry", error strings ("unknown cart", into_cart_unknown, cart_shared), and the fact that quote_id changes as re-checks progress. That is substantially more than the annotations convey.

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 front-loaded well — copy semantics, then when-to-use, then behavior, then limits — but it runs to several hundred words and reproduces parameter semantics already stated verbatim in the schema (the recheck 24-hour rule appears three separate times). Sections like "HOW A CART WORKS" and the cart_id-in-links warning are general cart model guidance rather than anything needed to invoke this tool, so the text is poorly sized for its job.

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 carries the full burden of describing returns and does so: quoted_anew per part, price_source values ("shared", "instant", "own"), copied true, recheck states (queued/asking/done), selection_match.status "none", and the error shapes. For a six-parameter, multi-mode tool with open-world side effects, 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.

Parameters4/5

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

Schema coverage is 100% and each parameter already carries a detailed description, yet the prose adds cross-parameter meaning the schema only partly encodes: for_link and recheck being mutually exclusive with into_cart_id, item_ids of one part yielding "a cart of one", and into_cart_id being refused when the target would exceed 24 parts or is shared/ordered. Some of this merely restates the schema, which keeps it from a 5.

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 opening sentence names a specific verb and resource ("Copy a cart") and immediately defines the copy's fidelity ("the same parts in the same order, each configured and picked as it was"). It clearly separates this tool from get_cart, add_to_cart, create_cart and refine_quote by describing the copy semantics and by telling the agent to work on the returned cart_id from then on.

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 triggers are given: use it when the user opens a shared cart, or with for_link true when the user wants to share their own cart. Alternatives are stated too — pass into_cart_id to merge into an existing cart, item_ids to copy a subset, recheck false to merely read, and "Never copy the same cart twice to refresh it — read the copy you have" explicitly rules out a tempting misuse.

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