Repository navigation
Add an MCP start_shopping tool that closes the current order - #458
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
start_shoppingMCP 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
startShoppingmutation. That callsOrder.start_shopping("1"):"1"onto a new id, and the checklist ticks are cleared."1"is the empty current order.How the tool maps to it
start_shoppingcalls that same function when the open order has a planned recipe or a manual quantity above zero. The reply isclosed: true,closed_order_id,current_order_id("1") andmode.If the open order is empty — nothing planned, only a quantity of 0, or the tool already closed it — the reply is
closed: falsewith "Nothing was closed: the current order is empty." It does not callstart_shoppingagain. 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 checkpassed (format, credo, compile, 194 tests, sobelow). Not deployed.