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
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Items to add, e.g. [{"item_id":"123","item_name":"Salad","quantity":1,"nested_options":[{"id":"456","name":"Ranch","quantity":1}]}] | |
| intent | Yes | One 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_id | Yes | Menu ID from get_menu (restaurants) or build_grocery_list/item details (grocery) | |
| store_id | Yes | Store ID the items belong to | |
| cart_uuid | No | Existing cart to append to (omit to create/append to store's open cart), or the group cart to add a guest to. | |
| group_cart | No | 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. | |
| fulfillment | No | Mode for a NEW cart (default delivery) | |
| group_cart_url | No | 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. | |
| guest_last_name | No | Guest's last name (required whenever guest_first_name is given) | |
| guest_first_name | No | 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. | |
| spend_limit_cents | No | 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. |