Skip to main content
Glama

Add custom print to cart

add_custom_to_cart

Put a finished custom print (from generate_custom_print) into the cart as a garment and return the updated cart. Call it once get_custom_print_status reports done and the human has chosen product and size; for catalog designs use add_to_cart instead. product is the garment the human picked in get_custom_print_options (default mens_oversize_tshirt); size must exist for it — an error lists the sizes. Adding the same print on the same product, size and fabric again grows that line (max 99). An unfinished print returns 'print is not ready' and nothing is added. Then checkout goes as usual: set_shipping_address → get_order_preview → prepare_order.

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": {
      "print_id": "<print_id>",
      "size": "<size>"
    },
    "name": "add_custom_to_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
qtyNoQuantity (default 1, max 99).
sizeYesSize label; must be available for the chosen product.
fabricNoFabric, if the product offers a choice (e.g. 'French terry 240 g, peach finish (K003)'); omit for the main fabric. An unavailable fabric returns an error listing the fabrics.
productNoGarment, as chosen in get_custom_print_options (default mens_oversize_tshirt).
print_idYesFinished print id — get_custom_print_status must report status=done.

Output Schema

NameRequiredDescriptionDefault
errorNoPresent instead of a cart when the call failed (bad index, unavailable size, ...).
itemsNoCart lines in index order — this index is what update_cart_item takes.
currencyNo
subtotalNoSum of price x qty over all lines, USD.
checkout_urlNoCart page URL for the human.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / items / items / properties / set
      Added value: +{
      +  "description": "Only on a line of a matching set: the pair it belongs to (both lines share key) and which part it is.",
      +  "properties": {
      +    "key": {
      +      "type": "string"
      +    },
      +    "role": {
      +      "description": "top or bottom.",
      +      "type": "string"
      +    },
      +    "title": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / print_id / description
      Previous value: -"Finished print id — get_studio_status must report status=done."New value: +"Finished print id — get_custom_print_status must report status=done."
    • changedInput schema / properties / product / description
      Previous value: -"Studio garment base, as chosen in get_studio_options (default mens_oversize_tshirt)."New value: +"Garment, as chosen in get_custom_print_options (default mens_oversize_tshirt)."
  3. Changed1 schema field changed
    • addedInput schema / properties / fabric
      Added value: +{
      +  "description": "Fabric, if the product offers a choice (e.g. 'French terry 240 g, peach finish (K003)'); omit for the main fabric. An unavailable fabric returns an error listing the fabrics.",
      +  "type": "string"
      +}
  4. Changed2 schema fields changed
    • changedInput schema / properties / product / description
      Previous value: -"Studio product base, same set as generate_custom_print (default mens_oversize_tshirt)."New value: +"Studio garment base, as chosen in get_studio_options (default mens_oversize_tshirt)."
    • addedInput schema / properties / product / enum
      Added value: +[
      +  "kids_basic_tshirt_boy",
      +  "kids_basic_tshirt_girl",
      +  "kids_oversize_tshirt_boy",
      +  "kids_oversize_tshirt_girl",
      +  "mens_basic_tshirt",
      +  "mens_oversize_tshirt",
      +  "womens_basic_tshirt",
      +  "womens_oversize_tshirt"
      +]
  5. Changed3 schema fields changed
    • changedInput schema / properties / print_id / description
      Previous value: -"Finished print id — studio_status must report status=done."New value: +"Finished print id — get_studio_status must report status=done."
    • changedInput schema / properties / product / description
      Previous value: -"Studio product base, same set as studio_generate (default mens_oversize_tshirt)."New value: +"Studio product base, same set as generate_custom_print (default mens_oversize_tshirt)."
    • changedOutput schema / properties / items / description
      Previous value: -"Cart lines in index order — this index is what set_cart_quantity/cart_update/cart_remove take."New value: +"Cart lines in index order — this index is what update_cart_item takes."
  6. Changed5 schema fields changed
    • addedInput schema / properties / print_id / description
      Added value: +"Finished print id — studio_status must report status=done."
    • addedInput schema / properties / product / description
      Added value: +"Studio product base, same set as studio_generate (default mens_oversize_tshirt)."
    • addedInput schema / properties / qty / description
      Added value: +"Quantity (default 1, max 99)."
    • addedInput schema / properties / size / description
      Added value: +"Size label; must be available for the chosen product."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "checkout_url": {
      +      "description": "Cart page URL for the human.",
      +      "type": "string"
      +    },
      +    "currency": {
      +      "type": "string"
      +    },
      +    "error": {
      +      "description": "Present instead of a cart when the call failed (bad index, unavailable size, ...).",
      +      "type": "string"
      +    },
      +    "items": {
      +      "description": "Cart lines in index order — this index is what set_cart_quantity/cart_update/cart_remove take.",
      +      "items": {
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "currency": {
      +            "type": "string"
      +          },
      +          "custom": {
      +            "description": "True when the line is a user-generated custom print.",
      +            "type": "boolean"
      +          },
      +          "fabric": {
      +            "type": "string"
      +          },
      +          "good_id": {
      +            "type": "integer"
      +          },
      +          "price": {
      +            "type": "number"
      +          },
      +          "product": {
      +            "type": "string"
      +          },
      +          "qty": {
      +            "type": "integer"
      +          },
      +          "size": {
      +            "type": "string"
      +          },
      +          "title": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "subtotal": {
      +      "description": "Sum of price x qty over all lines, USD.",
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  7. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Beyond the annotations, it discloses the merge rule (same print/product/size/fabric grows that line, capped at 99) and the failure semantics ('print is not ready' and nothing is added), which is real state-change context that idempotentHint=false alone does not convey. It stops short of noting permissions or whether the grown line is reversible, so 4 rather than 5.

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

Conciseness5/5

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

Front-loaded with purpose and precondition, then alternatives, then parameter caveats, then downstream flow. Every sentence carries distinct information — no boilerplate or repetition.

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?

An output schema exists, so return values need not be described, and the description still confirms the updated cart is returned. Relative to a 5-parameter mutation tool with prerequisite state, all an agent needs to invoke it correctly is present.

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 coverage is 100% and the description largely restates it — product default and enum, size/fabric availability errors that the schema already documents. It adds the useful constraint that size must exist for the chosen product with an error listing valid sizes, but this is marginal over an already-thorough schema, so baseline 3 applies.

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+resource ('Put a finished custom print into the cart as a garment') and explicitly separates it from the sibling 'add_to_cart', which is for catalog designs. An agent can select correctly without opening either 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?

Gives explicit preconditions ('Call it once get_custom_print_status reports done and the human has chosen product and size'), names the alternative for catalog designs, and even sequences the downstream checkout path (set_shipping_address → get_order_preview → prepare_order). When-to-use, when-not-to-use, and the fallback are all present.

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