Overview
Food delivery ordering is the first deployed scenario for Super Agent and the most typical demonstration of its capabilities. Super Agent connects to food delivery platforms through Clawdot Gateway, enabling AI to complete the entire workflow from searching merchants to creating orders, providing users with one-tap ordering experience.Capability Matrix
Super Agent’s core capabilities in food delivery scenarios (each capability maps to one or more MCP tools — 24 in the delivery MCP):Ordering is a stateful chain: every id returned by one step must be passed verbatim to the next — never fabricate ids or mix them across chains. See Order Flow for the full chain and field tables.
Typical Dialogue Scenario
Below is an example of a complete food delivery ordering dialogue workflow:Searching merchants and viewing menus both require a delivery location first. The address flow is
search_addresses to get candidates → select_address to register and obtain an address_id, which is then used for search, quote, and preview. The dialogue above omits this step, assuming the user already has a saved address.Agent Design Recommendations
Use Default Specs
Use Default Specs
Each product returned by
get_shop_menu carries ingredient_option_ids (the available spec / attribute / ingredient options) and marks the merchant-recommended default combination. Unless the user explicitly requests customization (“large to medium”, “add extra shot”, “no sugar”), use the default values directly.Benefits:- Avoid handling complex spec mutual exclusion logic (some spec combinations are not allowed)
- Speed up ordering workflow
- Select the most popular configuration
items is a list; each entry gives item_id / sku_id and the chosen ingredient_option_ids):Must Create After Preview
Must Create After Preview
Ordering is a strict two-step process:Correct approach ✅:
- preview_order → Get the final price plus a paired
preview_id+confirmation_token - create_order → Use the
preview_id+confirmation_tokenfrom the same preview to place the order
create_order. This prevents errors from incorrect ordering. The confirmation_token is the idempotency key — one token can place only one order.Wrong approach ❌:Address Management Strategy
Address Management Strategy
Address management is key to improving user experience:First use:
- Call
search_addresses(keyword="Optics Valley", lat=..., lng=...)to search POI - Display the returned
suggestionsfor the user to select - Call
select_address(...)with the chosen entry’ssuggestion_tokento register and obtain anaddress_id
search_addressesalso returnssaved_addresses[](most-recently-used first)- Reuse its
address_iddirectly, or prompt the user to select - When
lat/lngare passed, it also returnsnearest_address_id— you can pick the closest one - No need to search again each time
Error Handling
Error Handling
Common errors in food delivery scenarios and handling approaches:
General principles:
- Always show friendly error messages to users, not technical error codes
- Provide solutions or alternatives
- If necessary, proactively end the flow and wait for new user instructions
Core Workflow Deep Dive
Full chain:search_shops → get_shop_menu → quote_cart → select_address → preview_order → create_order → get_sign_action. The key segments are broken down below.
1. Search Merchants
Key points:- Without
keywordit is browse mode (up to 20 nearby shops with distance / rating / delivery fee); withkeywordit is precise search - Every result carries a
shop_idand acart_id; thecart_idencapsulates the shop and delivery location — pass it verbatim to downstream calls - Amount fields (e.g.
min_order_amount) are in cents
2. Get Menu and Specs
Key points:- Menus can be large (100+ items); use
keywordorlimit/offsetfor progressive disclosure - Each item carries an orderable
item_id/sku_idplus the availableingredient_option_ids - Agent merges user input (e.g., “iced”) with defaults to build the
itemsfor ordering
3. Preview + Create
Key points:preview_orderautomatically selects the optimal coupon (coupon_idsis tri-state: omit = auto-select best;[]= no coupon; an explicit list = use those coupons)preview_id+confirmation_tokenmust be used as a pair and are valid for ~10 minutes- The user must confirm before
create_order;confirmation_tokenis the idempotency key - After ordering it returns
order_idand (when payment is needed)payment_action; passwordless-payment orders must first complete signing viaget_sign_action
Best Practices Summary
✅ Recommended
- Use the menu’s default specs to speed up workflow
- Display price after preview, wait for confirmation before
create_order - Reuse
saved_addressesto avoid re-entry - Proactively update order status
- Provide friendly error messages
❌ Avoid
- Create without previewing
- Let users handle spec mutual exclusion
- Search addresses again each time
- Return technical error codes to users
- Ignore
confirmation_tokenexpiration
Related Reading
- Order Flow — full end-to-end chain and per-step fields
- Authentication — API Key identifies the Agent, consent grant identifies the authorized user
- Item Specs — spec / attribute / ingredient system
- MCP Tools Overview — the 18-tool contract
Authentication is two-layered:
Authorization: Bearer clw_... identifies the Agent; the user authorization (a cg_-prefixed consent grant) is passed as the consent_grant_id argument in MCP tools. The public MCP endpoint is /mcp/v1. Creating an Agent and issuing API Keys is done in the Portal.
