MCP builds match REST
Store names
- A
buildwith aplaceIdand a restaurant name now checks every word of the name against the store's name and address, asPOST /v1/cartsdoes. A name the store does not carry answersstoreMismatchand builds nothing. - A
buildorpreviewfor a name Layout finds no restaurant by answersstore_not_found, with nearby restaurants of other names ascandidates. Offer them by their own names, and build at one only if the person picks it. - In sandbox, a name or
test_place_id that no test restaurant carries answersstore_not_found, with the test restaurants as candidates.
Cancel while building
A build grant can now cancel a cart that is still building: order with action: "status", cancel: true and that build's idempotencyKey answers cancel.status: "canceling". Layout releases the cart as soon as it is built, and never texts the person about it. It works only for a build your application started. See The order actions.
ord_ ids
orderId now takes the ord_ publicOrderId on order_status, confirm and a cancel. A build grant reads only its own application's orders. See The tools.
Ready, expired and canceled carts
- A ready cart nobody has confirmed, read by
orderId, answersplacement.status: "carted"withtotalMinor,priceandexpiresAt, where it answeredbuilding. It waits on the person, so stop polling it. - A cart past its confirm window reads
cart_expiredby key, andfailedwithexpired: truebyorderId, withfailureCode: "CART_EXPIRED", where it wasOUR_TIMEOUT. - A cart the person canceled reads
canceledby key.
Confirm totals
A confirm that goes ahead carries totalMinor, the total you confirmed with, fee included; merchantTotalMinor, the restaurant's own total; and subtotalMinor, the food before tax. See Confirm in sandbox.
grant_expired
An expired build grant sent to mcp.layout.link now answers 401 with error.code: "grant_expired", as on api.layout.link. Mint a new grant. Any other refused grant still answers unauthorized. A confirm or resend answered rate_limited now carries retryAfterSec. See MCP refusals.
Build session tools
mcp-tools.json adds buildSessionTools, the tools as a build grant's tools/list returns them. See MCP tools.
Breaking changes
- A
buildwhose name has a word the store does not carry now answersstoreMismatch, where it could build. - A
buildfor a name Layout cannot find now answersstore_not_found, where it could ask which of several other restaurants. - A confirm's
subtotalMinoris now the food before tax, not the restaurant's total. ReadmerchantTotalMinorfor that. - Polling a ready cart by
orderIdnow getscartedat once, notbuilding. - An expired cart reads
CART_EXPIRED, notOUR_TIMEOUT. - An expired build grant gets
grant_expired, notunauthorized.