# Agent Instructions — Lea's MAD Cookies

This document describes how AI agents can interact with Lea's MAD Cookies's online store at https://leas-mad-cookies.storeza.ai/.

## Commerce Protocol (UCP)

This store supports agent-driven commerce via a cash-on-delivery profile of the Universal Commerce Protocol (UCP). Endpoints:

- **Discovery** — `GET https://leas-mad-cookies.storeza.ai/.well-known/ucp` returns the store's UCP profile: capabilities, endpoints, and payment policy.
- **MCP endpoint** — `POST https://leas-mad-cookies.storeza.ai/api/ucp/mcp` with `Content-Type: application/json`. Use the MCP `tools/list` method to discover tools and schemas, and `tools/call` to invoke them.

### Payment: Cash on Delivery only

This store does **not** take card or agent payments. Orders are paid in cash on delivery. Placing a checkout creates a COD order; the buyer pays the courier in person.

### Typical Agent Flow

1. **Discover** — `GET /.well-known/ucp` to confirm capabilities.
2. **Search** — `search_catalog` to find products matching the buyer's intent.
3. **Cart** — `create_cart` to price the desired items (server recomputes totals).
4. **Checkout** — `create_checkout` to preview the order and total.
5. **Complete** — `complete_checkout` to place the cash-on-delivery order (buyer must approve).
6. **Track** — `get_order_status` with the order number + buyer phone or email.

### Important Rules

- **Checkout requires human approval.** Do not call `complete_checkout` without the buyer's explicit consent. You must collect the buyer's name, phone, and delivery address, confirm the items and total, then set `buyer_approved: true`.
- **No payment is handled.** This is cash on delivery; never request card details.
- **Respect rate limits.** The MCP endpoint is rate-limited per IP. Back off on `429` responses with exponential delay.
- **Use buyer context.** Pass the delivery `city`/`address` for accurate fulfillment.

### Available MCP Tools

- `search_catalog` — Search this store's public products by free-text query and/or category. Returns matching products with price, currency, availability, URL and image.
- `get_product` — Get full details for one product by id or slug, including size/color options.
- `create_cart` — Build a priced cart from items. Validates availability and recomputes totals server-side. Returns line items, subtotal, delivery fee and total. Stateless — pass the returned cart to create_checkout.
- `create_checkout` — Preview a cash-on-delivery checkout: validates items + buyer details and returns an order summary and total to confirm. Does NOT place the order. No payment is taken.
- `complete_checkout` — Place a cash-on-delivery order. The buyer must have explicitly approved this purchase. Requires buyer name, phone and delivery address. Returns the order number and status. Payment is cash on delivery — the buyer pays the courier; no card or agent payment is involved.
- `get_order_status` — Look up the status of an order by order number. Requires the buyer's phone OR email on the order for verification.

## Read-Only Browsing

For agents that only need to read store data without transacting:

- Store homepage: `GET https://leas-mad-cookies.storeza.ai/`
- Product page: `GET https://leas-mad-cookies.storeza.ai/product/{slug}`
- Product feed (JSON): `GET https://leas-mad-cookies.storeza.ai/feed.json`
- Sitemap: `GET https://leas-mad-cookies.storeza.ai/sitemap.xml`
- AI summary: `GET https://leas-mad-cookies.storeza.ai/llms.txt`

## Categories

- Classic: https://leas-mad-cookies.storeza.ai/?category=546432dc-25e1-47db-926c-921c49b57da6
- Diet Friendly: https://leas-mad-cookies.storeza.ai/?category=ca8deb02-b410-41c3-9830-2288177268a5
- Outrageous Cravings: https://leas-mad-cookies.storeza.ai/?category=2468d1d9-5bb4-433a-9163-52c843a21007

## Products (snapshot)

- matcha cookie — 5.00 USD — Out of stock — https://leas-mad-cookies.storeza.ai/product/matcha-cookie
- choc chip cookie — 3.00 USD — Limited availability — https://leas-mad-cookies.storeza.ai/product/choc-chip-cookie
- chocolate sea salt — 3.00 USD — Limited availability — https://leas-mad-cookies.storeza.ai/product/chocolate-sea-salt
- holiday — 10.00 USD — Preorder — https://leas-mad-cookies.storeza.ai/product/holiday
- double choc — 10.00 USD — In stock — https://leas-mad-cookies.storeza.ai/product/double-choc
- Oreo center — 10.00 USD — In stock — https://leas-mad-cookies.storeza.ai/product/oreo-center

## Platform

This store is built on Storeza (https://storeza.ai), an AI store builder for small businesses. Storeza stores are cash-on-delivery and expose a UCP profile per store for agent-driven commerce.
