doordash_place_order
Place a DoorDash order to complete your food delivery. This tool submits your cart for processing and charges your payment method.
Instructions
Place a DoorDash order. THIS WILL CHARGE YOUR CARD.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart_id | Yes | Cart ID from doordash_checkout | |
| tip_cents | No | Tip in cents (default 0) | |
| payment_card_id | No | Payment card ID | |
| store_id | No | Store ID (auto-detected) |
Implementation Reference
- src/tools/index.ts:621-652 (handler)Handler implementation for 'doordash_place_order' which invokes the checkout API to create an order.
({ cart_id, tip_cents, payment_card_id, store_id }) => wrap(async () => { // Get fee tally for total const summary = await api.checkout.getFeeTally(cart_id); if (summary.totalCents === 0) return err("Could not determine order total."); // Resolve store ID let sid = store_id ?? ""; if (!sid) { const carts = await api.cart.listCarts(); sid = carts.find((c) => c.id === cart_id)?.storeId ?? ""; } const result = await api.checkout.createOrder({ cartId: cart_id, storeId: sid, totalCents: summary.totalCents, tipCents: tip_cents, paymentCardId: payment_card_id, }); if (result.paymentStatus === "paid") { return ok( `Order placed and payment confirmed! Order ID: ${result.orderUuid}\nTotal: $${(result.totalCents / 100).toFixed(2)} (includes $${(result.tipCents / 100).toFixed(2)} tip)\n\nUse doordash_order_status to track.`, ); } if (result.paymentStatus === "failed") { return err( `Order submitted but payment failed: ${result.errorMessage}`, ); } - src/tools/index.ts:607-657 (handler)The "doordash_place_order" tool is registered and implemented in src/tools/index.ts. It calls the checkout API to create an order.
"doordash_place_order", { description: "Place a DoorDash order. THIS WILL CHARGE YOUR CARD.", inputSchema: { cart_id: z.string().describe("Cart ID from doordash_checkout"), tip_cents: z .number() .optional() .default(0) .describe("Tip in cents (default 0)"), payment_card_id: z.string().optional().describe("Payment card ID"), store_id: z.string().optional().describe("Store ID (auto-detected)"), }, }, ({ cart_id, tip_cents, payment_card_id, store_id }) => wrap(async () => { // Get fee tally for total const summary = await api.checkout.getFeeTally(cart_id); if (summary.totalCents === 0) return err("Could not determine order total."); // Resolve store ID let sid = store_id ?? ""; if (!sid) { const carts = await api.cart.listCarts(); sid = carts.find((c) => c.id === cart_id)?.storeId ?? ""; } const result = await api.checkout.createOrder({ cartId: cart_id, storeId: sid, totalCents: summary.totalCents, tipCents: tip_cents, paymentCardId: payment_card_id, }); if (result.paymentStatus === "paid") { return ok( `Order placed and payment confirmed! Order ID: ${result.orderUuid}\nTotal: $${(result.totalCents / 100).toFixed(2)} (includes $${(result.tipCents / 100).toFixed(2)} tip)\n\nUse doordash_order_status to track.`, ); } if (result.paymentStatus === "failed") { return err( `Order submitted but payment failed: ${result.errorMessage}`, ); } return ok( `Order submitted. Order ID: ${result.orderUuid}\nPayment processing. Use doordash_order_status to check.`, ); }), ); - src/tools/index.ts:606-620 (registration)MCP tool registration for 'doordash_place_order' including input schema.
server.registerTool( "doordash_place_order", { description: "Place a DoorDash order. THIS WILL CHARGE YOUR CARD.", inputSchema: { cart_id: z.string().describe("Cart ID from doordash_checkout"), tip_cents: z .number() .optional() .default(0) .describe("Tip in cents (default 0)"), payment_card_id: z.string().optional().describe("Payment card ID"), store_id: z.string().optional().describe("Store ID (auto-detected)"), }, },