Skip to content

Add an MCP start_shopping tool that closes the current order - #458

Merged
adri merged 1 commit into
masterfrom
cursor/start-shopping-mcp-906d
Nov 4, 2026
Merged

adri merged 1 commit into
masterfrom
cursor/start-shopping-mcp-906d

Conversation

@adri

@adri adri commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the start_shopping MCP tool the shopping-list descriptions already name. It closes Picape's current order and leaves an empty one, in ah, picnic and checklist mode. It never places an order, checks out, or picks a delivery slot.

What the button does today

On the list screen, "Bestelling ontvangen" (or "Boodschappen gedaan" in checklist mode) runs the startShopping mutation. That calls Order.start_shopping("1"):

  • The plan (planned recipes and manual quantities) moves off the open order "1" onto a new id, and the checklist ticks are cleared. "1" is the empty current order.
  • In ah mode the same call copies the supermarket basket into Picape's own order history. Picnic skips that copy, because Picnic product ids are strings and the snapshot column is numeric. Checklist uses the same function; a basket read that fails is ignored and the plan still moves.
  • Nothing is sent that would place, pay, or book a slot. The ah basket read is only there to copy what was already ordered into Picape.

How the tool maps to it

start_shopping calls that same function when the open order has a planned recipe or a manual quantity above zero. The reply is closed: true, closed_order_id, current_order_id ("1") and mode.

If the open order is empty — nothing planned, only a quantity of 0, or the tool already closed it — the reply is closed: false with "Nothing was closed: the current order is empty." It does not call start_shopping again. That matters in ah mode: the button's function does not empty the shop basket, so a second call would snapshot that basket into another closed order. Product ids are left as they are.

mix check passed (format, credo, compile, 194 tests, sobelow). Not deployed.

Open in Web Open in Cursor 

The tool calls Order.start_shopping/1, the same function as the app's
"Bestelling ontvangen" button, and refuses to close an empty order so a
second call cannot mint another one.

Co-authored-by: Adrian Philipp <adri@users.noreply.github.com>
@adri
adri merged commit dd44c73 into master Nov 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants