doordash_cart
View current DoorDash cart contents and totals to manage food delivery orders programmatically.
Instructions
View your current DoorDash cart contents and totals
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:434-458 (handler)The doordash_cart tool is registered and implemented in src/tools/index.ts, where it calls the api.cart.listCarts() method to retrieve and format cart information.
server.registerTool( "doordash_cart", { description: "View your current DoorDash cart contents and totals" }, () => wrap(async () => { const carts = await api.cart.listCarts(); if (carts.length === 0) return err("Cart is empty."); const lines = ["# Your Carts\n"]; for (const cart of carts) { const group = cart.isGroupOrder ? " (GROUP ORDER)" : ""; lines.push(`**${cart.storeName}**${group}`); lines.push(`Cart ID: ${cart.id}`); for (const item of cart.items) { const price = item.price ? `$${(item.price / 100).toFixed(2)}` : ""; lines.push( `- ${item.quantity}x **${item.name}** ${price} (item ID: ${item.id})`, ); } if (cart.subtotal) lines.push(`\nSubtotal: $${(cart.subtotal / 100).toFixed(2)}`); lines.push(""); } return ok(lines.join("\n")); }),