place_order
Place a complete Chipotle order by selecting your entree, protein, rice, beans, toppings, and optional sides and drinks.
Instructions
Place a complete Chipotle order. Provide your entree details, optional sides, and drinks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entree | Yes | Type of entree | |
| protein | Yes | Choice of protein | |
| rice | Yes | Choice of rice | |
| beans | Yes | Choice of beans | |
| toppings | Yes | List of toppings | |
| double_protein | No | Double protein | |
| sides | No | Optional sides | |
| drinks | No | Optional drinks | |
| name | Yes | Name for the order |
Implementation Reference
- index.js:176-258 (handler)The 'place_order' tool implementation handles the complete ordering flow, including price calculation, order creation with simulated state, and generating a confirmation receipt.
server.tool( "place_order", "Place a complete Chipotle order. Provide your entree details, optional sides, and drinks.", { entree: z.enum(ENTREES).describe("Type of entree"), protein: z.enum(PROTEINS).describe("Choice of protein"), rice: z.enum(RICES).describe("Choice of rice"), beans: z.enum(BEANS).describe("Choice of beans"), toppings: z .array(z.enum(TOPPINGS)) .min(0) .max(TOPPINGS.length) .describe("List of toppings"), double_protein: z.boolean().default(false).describe("Double protein"), sides: z.array(z.enum(SIDES)).default([]).describe("Optional sides"), drinks: z.array(z.enum(DRINKS)).default([]).describe("Optional drinks"), name: z.string().describe("Name for the order"), }, async ({ entree, protein, rice, beans, toppings, double_protein, sides, drinks, name }) => { let price = { Burrito: 10.75, Bowl: 10.75, "Tacos (3)": 10.75, Salad: 10.75, Quesadilla: 11.5, "Kid's Meal": 6.25 }[entree] || 10.75; if (double_protein) price += 3.75; if (toppings.includes("Guacamole")) price += 2.95; if (toppings.includes("Queso Blanco")) price += 1.65; const sidePrices = { Chips: 1.95, "Chips & Guac": 5.45, "Chips & Queso": 4.25, "Chips & Salsa": 2.95 }; for (const side of sides) price += sidePrices[side] || 0; const drinkPrice = 2.65; price += drinks.length * drinkPrice; const tax = price * 0.0825; const total = price + tax; const orderId = generateOrderId(); const waitTime = getWaitTime(); const order = { id: orderId, name, entree, protein: double_protein ? `Double ${protein}` : protein, rice, beans, toppings, sides, drinks, subtotal: price.toFixed(2), tax: tax.toFixed(2), total: total.toFixed(2), status: "Being Prepared", estimatedWait: waitTime, placedAt: new Date().toISOString(), }; orders.push(order); const receipt = [ "# Order Confirmed!", "", `**Order #${orderId}** for **${name}**`, "", "---", `**${entree}**`, ` Protein: ${order.protein}`, ` Rice: ${rice}`, ` Beans: ${beans}`, ` Toppings: ${toppings.length > 0 ? toppings.join(", ") : "None"}`, "", ...(sides.length > 0 ? ["**Sides:** " + sides.join(", "), ""] : []), ...(drinks.length > 0 ? ["**Drinks:** " + drinks.join(", "), ""] : []), "---", `Subtotal: $${order.subtotal}`, `Tax: $${order.tax}`, `**Total: $${order.total}**`, "", `Estimated wait: ~${waitTime} minutes`, "", `> ${getRandomQuip()}`, ]; return { content: [{ type: "text", text: receipt.join("\n") }] }; } );