doordash_checkout
Preview checkout details including fees and total before placing an order through the DoorDash MCP server.
Instructions
Preview checkout details (fees, total). Does NOT place the order.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "doordash_checkout"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart_id | No | Cart ID. Uses most recent if not specified. |
Implementation Reference
- src/tools/index.ts:568-604 (handler)The implementation of the `doordash_checkout` tool, which previews order fees and totals.
server.registerTool( "doordash_checkout", { description: "Preview checkout details (fees, total). Does NOT place the order.", inputSchema: { cart_id: z .string() .optional() .describe("Cart ID. Uses most recent if not specified."), }, }, ({ cart_id }) => wrap(async () => { let cartId = cart_id ?? ""; let storeName = "Unknown"; if (!cartId) { const carts = await api.cart.listCarts(); if (carts.length === 0) return err("Cart is empty."); cartId = carts[0].id; storeName = carts[0].storeName; } const summary = await api.checkout.getFeeTally(cartId); const lines = [`# Checkout: ${storeName}\n`]; for (const item of summary.lineItems) { lines.push(`- ${item.label}: ${item.amount}`); } if (summary.total) lines.push(`\n**Total: ${summary.total}**`); lines.push(`\nCart ID: ${cartId}`); lines.push( "\n*Call doordash_place_order with this cart ID to place the order.*", ); return ok(lines.join("\n")); }), );