Skip to main content
Glama

add_items_to_cart

Add menu items to a DoorDash cart, create one if none exists, and append quantities for guests or group orders.

Instructions

Add items to a cart (creates one if no cart_uuid passed and none open at the store). Also the only way to add for a GUEST — see guest_first_name. APPEND semantics: re-adding an item_id SUMS quantities. Items need item_id + item_name + quantity; customizations go in nested_options[] (entries: id, name, quantity, optional recursive options[]). Weight-priced items (deli, butcher, produce) take a decimal quantity in their own unit — the final charge is by actual weight, so tell the user the price is an estimate. Items the merchant ships with default modifications keep them unless you pass default_handling 'exact'. On required-options failure the response lists required_options[] — ask the user to choose, then retry. Check list_carts first.

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": {
      "store_id": "<store_id>",
      "menu_id": "<menu_id>",
      "items": "<items>",
      "intent": "<intent>"
    },
    "name": "add_items_to_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesItems to add, e.g. [{"item_id":"123","item_name":"Salad","quantity":1,"nested_options":[{"id":"456","name":"Ranch","quantity":1}]}]
intentYesOne short line stating who this is for and the goal, e.g. 'Help the user order dinner'. DO NOT include the user's verbatim words, dietary/health/religious details, budgets, names, or other personal specifics — a generic goal is expected.
menu_idYesMenu ID from get_menu (restaurants) or build_grocery_list/item details (grocery)
store_idYesStore ID the items belong to
cart_uuidNoExisting cart to append to (omit to create/append to store's open cart), or the group cart to add a guest to.
group_cartNoCreate a shareable GROUP cart (no cart_uuid). Response carries group_cart_url — share it with participants. Not for joining one (use group_cart_url) and not for guest adds.
fulfillmentNoMode for a NEW cart (default delivery)
group_cart_urlNoJoin someone else's group cart from its shared link and add in one call. Use the cart_uuid the response returns for any later adds. Only for the signed-in user joining as themselves — a guest never joins.
guest_last_nameNoGuest's last name (required whenever guest_first_name is given)
guest_first_nameNoAdd these items for a GUEST — someone with no DoorDash account, whose items sit in their own sub-cart of a group cart the signed-in user hosts. Pass with guest_last_name and the group cart's cart_uuid. Peckish remembers the guest by name, so pass the same name for every later add and their items stay together.
spend_limit_centsNoPer-participant spend limit in CENTS for a NEW host-pays group cart (2500 = $25). Requires group_cart; cannot combine with cart_uuid. Omit for unlimited. The host is exempt from their own limit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.6.0
    • changedInput schema / properties / cart_uuid / description
      Previous value: -"Existing cart to append to (omit to create/append to store's open cart). For someone else's group cart: pass their cart_uuid to join as a participant."New value: +"Existing cart to append to (omit to create/append to store's open cart), or the group cart to add a guest to."
    • changedInput schema / properties / group_cart / description
      Previous value: -"Create a shareable GROUP cart (no cart_uuid), or join another person's group cart (with their cart_uuid). Response carries group_cart_url — share it with participants."New value: +"Create a shareable GROUP cart (no cart_uuid). Response carries group_cart_url — share it with participants. Not for joining one (use group_cart_url) and not for guest adds."
    • addedInput schema / properties / group_cart_url
      Added value: +{
      +  "description": "Join someone else's group cart from its shared link and add in one call. Use the cart_uuid the response returns for any later adds. Only for the signed-in user joining as themselves — a guest never joins.",
      +  "type": "string"
      +}
    • addedInput schema / properties / guest_first_name
      Added value: +{
      +  "description": "Add these items for a GUEST — someone with no DoorDash account, whose items sit in their own sub-cart of a group cart the signed-in user hosts. Pass with guest_last_name and the group cart's cart_uuid. Peckish remembers the guest by name, so pass the same name for every later add and their items stay together.",
      +  "type": "string"
      +}
    • addedInput schema / properties / guest_last_name
      Added value: +{
      +  "description": "Guest's last name (required whenever guest_first_name is given)",
      +  "type": "string"
      +}
    • addedInput schema / properties / items / items / properties / default_handling
      Added value: +{
      +  "description": "How to treat the merchant's default modifications on this item: 'default' (omit) keeps them; 'exact' takes the item with only the nested_options listed here. Only pass 'exact' when the user asked for a plain/unmodified version",
      +  "enum": [
      +    "default",
      +    "exact"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / items / items / properties / quantity / description
      Previous value: -"Quantity (integer for count items)"New value: +"Quantity — integer for count items, decimal in the item's unit for weight-priced items (0.5 = half a pound where the unit is lb)"
    • addedInput schema / properties / items / items / properties / unit
      Added value: +{
      +  "description": "Unit for a weight-priced item, as the menu/item details reported it (e.g. 'lb', 'kg'). Omit for count items",
      +  "type": "string"
      +}
    • changedInput schema / properties / spend_limit_cents / description
      Previous value: -"Per-participant spend limit in CENTS for a NEW host-pays group cart (2500 = $25). Requires group_cart; cannot combine with cart_uuid. Omit for unlimited."New value: +"Per-participant spend limit in CENTS for a NEW host-pays group cart (2500 = $25). Requires group_cart; cannot combine with cart_uuid. Omit for unlimited. The host is exempt from their own limit."
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations establish it is a non-read-only, non-destructive, open-world mutation, so the remaining burden is flow behavior — and the description delivers: append/summing, weight-priced estimate caveat, default modification retention unless default_handling 'exact', and the required_options[] failure/retry loop. These are operational traits no annotation or schema field conveys.

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

Conciseness4/5

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

Front-loaded with the core action and append rule, and nearly every sentence carries distinct operational content. It is dense and slightly jammed — the weight-estimate and default_handling notes read as parenthetical asides that could be tightened — but there is little filler.

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 an 11-parameter mutation with no output schema, the description covers the full decision surface: cart creation vs append, group cart creation vs join, guest sub-carts, weight estimation, default modification handling, and recovery from a required-options failure. Nothing an agent needs to invoke 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%, so baseline is 3; the description earns above that by documenting cross-parameter constraints the schema cannot express — guest adds need a group cart's cart_uuid, spend_limit_cents requires group_cart and cannot combine with cart_uuid, and fulfillment only applies to NEW carts. Minor gap: it does not restate the 'intent' privacy rule beyond what the schema already says.

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 ('Add items to a cart') and immediately layers distinguishing scope: creation-if-absent, the only guest path, and APPEND semantics where re-adding sums quantities. That append rule alone separates it from any naive 'add' interpretation and tells an agent what happens on repeat calls.

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?

Explicitly directs 'Check list_carts first' and names the alternatives inline: group_cart_url for joining vs group_cart for creating, and guest_first_name for the no-account case. When-not conditions are stated for the ambiguous params ('Not for joining one', 'a guest never joins').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.