Schema module.
DrinkId
Valid identifiers for drinks on the menu.| Value | Drink |
|---|---|
espresso | Espresso |
americano | Americano |
latte | Latte |
cappuccino | Cappuccino |
cold-brew | Cold Brew |
tea | Tea |
DrinkSize
Cup size options, each with a price multiplier applied tobasePriceCents.
| Value | Price multiplier |
|---|---|
small | 1.00× |
medium | 1.15× |
large | 1.30× |
Milk
Milk options available for drinks that support customization.MenuItem.availableMilks for the valid set per drink.
Temperature
Serving temperature options.MenuItem.availableTemperatures.
OrderStatus
The complete set of lifecycle states for a coffee order.Transition diagram
Only the following status transitions are valid. Attempting any other transition produces anInvalidOrderStatusTransitionError (409).
| From | Allowed transitions |
|---|---|
pending | brewing, cancelled |
brewing | ready, cancelled |
ready | picked-up |
picked-up | (terminal — no transitions) |
cancelled | (terminal — no transitions) |
OrderId
A string identifier for a specific order, constrained to the patternorder-{N}.
The
orderId parameter on all tools and the coffee://orders/:orderId resource URI both validate against this pattern at runtime.MenuItem
Describes a single drink offering on the menu.Unique drink identifier.
Human-readable display name shown to customers.
Internal drink category used for business logic (e.g., default shot count).
Base price in US cents before the size multiplier and extra-shot surcharges are applied. Extra shots beyond the default cost 75 cents each.
The subset of milk options supported by this drink.
The subset of temperature options supported by this drink.
Maximum number of espresso shots that may be added. Always
0 for tea.CoffeeOrder
The full persisted record for a single order.Unique order identifier matching
order-{N}.Name supplied when the order was placed.
The ordered drink’s identifier.
Human-readable drink name resolved from the menu at order time.
The chosen cup size.
The resolved milk preference (defaulted from the menu if not provided).
The resolved serving temperature (defaulted from the menu if not provided).
Number of espresso shots included in the order.
Optional free-text instructions from the customer.
Current lifecycle status of the order.
Final price in US cents:
round(basePriceCents × sizeMultiplier) + max(shots − defaultShots, 0) × 75.ISO 8601 UTC timestamp recorded when the order was persisted.
PlaceOrderRequest
Input schema accepted by theplace_order tool.
Name of the customer placing the order.
Must resolve to a valid
DrinkId. Validated against the menu at the service layer.Must resolve to a valid
DrinkSize (small, medium, or large).Optional milk preference. Defaults to the drink’s primary available milk when omitted.
Optional temperature preference. Defaults to the drink’s first available temperature when omitted.
Optional shot count. Defaults to
1 for espresso-based drinks and 0 for tea.Optional free-text special instructions.
ListOrdersRequest
Input schema accepted by thelist_orders tool.
Optional status filter. Must resolve to a valid
OrderStatus when provided. Omitting this field returns all orders regardless of status.Errors
All errors are tagged EffectSchema.TaggedErrorClass instances. Every tool response may fail with any member of the AppError union.
DrinkNotFoundError
Returned whendrinkId does not match any item in the menu.
| Property | Value |
|---|---|
| HTTP status | 404 |
| Tag | "DrinkNotFoundError" |
The unrecognized drink identifier that was supplied.
InvalidOrderInputError
Returned when order input fails business-rule validation (e.g., milk not available for the chosen drink).| Property | Value |
|---|---|
| HTTP status | 400 |
| Tag | "InvalidOrderInputError" |
Human-readable description of the validation failure.
OrderNotFoundError
Returned when anorderId does not correspond to any persisted order.
| Property | Value |
|---|---|
| HTTP status | 404 |
| Tag | "OrderNotFoundError" |
The order ID that was not found.
InvalidOrderStatusTransitionError
Returned when a status-change tool is called on an order that is not in the required source status.| Property | Value |
|---|---|
| HTTP status | 409 |
| Tag | "InvalidOrderStatusTransitionError" |
The order on which the transition was attempted.
The order’s current (source) status.
The target status that was requested but is not permitted from
from.PersistenceError
Returned when a storage operation fails unexpectedly.| Property | Value |
|---|---|
| HTTP status | 500 |
| Tag | "PersistenceError" |
Description of the failed storage operation.
The underlying defect, if available. Populated by
PersistenceError.refail.InternalAppError
Returned when an unexpected application-level error occurs, including errors surfaced fromPersistenceError through the service layer.
| Property | Value |
|---|---|
| HTTP status | 500 |
| Tag | "InternalAppError" |
Description of the internal failure.
The underlying defect, if available.