Skip to main content
Glama

Place an order

place_order
Idempotent

Place an order against the agent_session_id from start_order_session. Atomically inserts the order + items, applies server-side canonical pricing + tax (do NOT trust the unit_price you compute — we re-read it from D1), decrements inventory and optionally redeems a promo code. The guest pays at the venue (payment_status 'unpaid'). At a venue that takes payment before preparing (pay_first: true) the order is held as 'awaiting' and payment_url is returned: give it to the guest — they pay on the restaurant's own checkout, exactly like a guest ordering from the table; the kitchen gets the order once it is paid, and an unpaid order expires. This tool never charges anything itself. Returns order_id, total_cents (tax-inclusive), currency, promo_discount and, when pay_first, payment_url. Idempotency-Key header REQUIRED.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoOptional order-level note (max 500 chars).
itemsYes
table_idNoOptional table id when ordering at a table.
guest_nameNoOptional guest name shown to staff with the order.
order_typeNoChannel: 'dine_in' (default — at a table) or 'takeaway' (pickup; requires customer_name + customer_phone, ignores table_id, only when the restaurant has takeaway enabled — else channel_not_available). Delivery is not offered to agents.
promo_codeNoOptional promo code to redeem at order time (validate first with apply_promo). The redemption slot is consumed only when this order lands.
customer_nameNoRequired for takeaway — who picks the order up.
customer_phoneNoRequired for takeaway — reachable phone (digits, +, spaces/dashes tolerated).
agent_session_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / guest_name / description
      Previous value: -"Required when room_id is set."New value: +"Optional guest name shown to staff with the order."
    • changedInput schema / properties / order_type / description
      Previous value: -"Channel: 'dine_in' (default — table or room) or 'takeaway' (pickup; requires customer_name + customer_phone, ignores table_id/room_id, only when the restaurant has takeaway enabled — else channel_not_available). Delivery is not offered to agents."New value: +"Channel: 'dine_in' (default — at a table) or 'takeaway' (pickup; requires customer_name + customer_phone, ignores table_id, only when the restaurant has takeaway enabled — else channel_not_available). Delivery is not offered to agents."
    • removedInput schema / properties / room_id
      Removed value: -{
      -  "description": "Hotel room id (room service): an active room of this venue. Not with table_id; guest_name is required.",
      -  "type": "string"
      -}
  2. Changed1 schema field changed
    • changedInput schema / properties / room_id / description
      Previous value: -"Diamond tier only — hotel room id."New value: +"Hotel room id (room service): an active room of this venue. Not with table_id; guest_name is required."
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations (idempotent, non-readOnly, non-destructive), it discloses the atomic insert, server-side canonical pricing/tax override ('do NOT trust the unit_price you compute'), inventory decrement, the 'awaiting' hold state, unpaid-order expiry, and that it never charges. It also flags the REQUIRED Idempotency-Key header, which the annotations only imply.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense and front-loaded: purpose, atomicity/pricing rule, then the pay_first payment branch and return values. Every sentence contributes, though the middle payment paragraph is lengthy and could be tightened slightly without losing information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description enumerates the return fields (order_id, total_cents, currency, promo_discount, payment_url) and explains the payment lifecycle. For a mutation tool with 9 parameters and a conditional payment branch, nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 78%, so the schema carries most parameter detail. The description still adds behavioral meaning: pricing is re-read from D1 regardless of the caller's unit_price, the promo redemption slot is consumed only when the order lands, and takeaway requires customer_name/customer_phone. It does not restate the per-field constraints, which is acceptable.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource ('Place an order') and immediately scopes it to the agent_session_id from start_order_session, distinguishing it from cart-building siblings like create_cart and get_cart. An agent can tell exactly what this tool does and what it produces without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It establishes the prerequisite flow (agent_session_id from start_order_session, promo validated first with apply_promo) and explains the pay_first branch decision clearly. It stops short of explicitly stating when not to use it versus siblings such as create_cart, but the session-flow context is strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources