Skip to content

Option groups: join the option library, read Wolt's ranges, accept options in wolt_cart_add - #69

Merged
mekedron merged 1 commit into
mainfrom
fix/option-groups-and-mcp-options
Nov 13, 2026
Merged

mekedron merged 1 commit into
mainfrom
fix/option-groups-and-mcp-options

Conversation

@mekedron

Copy link
Copy Markdown
Owner

Summary

Restaurant dishes with options were described wrongly in both the CLI and the MCP server. The MCP tool wolt_venue_item showed every option group with no values. Both surfaces showed every group as optional with a range of 0 to 0. As a result, a dish with a required, paid choice showed only its base price. wolt_cart_add could also add such a dish with no options at all, and an MCP client had no way to pick options.

Now both surfaces show each group's values, prices, limits and default value. They also show the price with the required defaults, the price the Wolt app shows. When a required group is left out, wolt cart add and wolt_cart_add use its default value, just as the Wolt app preselects it. wolt_cart_add accepts option choices and includes their prices in the line price.

Nothing needed from you.

Fixes #65
Fixes #66

Details

  • Wolt splits a dish's option group in two. The item-level entry has the name, multi_choice_config.total_range and prerequisite_values. The venue library entry, linked by option_id, has the values, prices and default_value. payloadutil.JoinOptionLibrary joins them for the MCP item path (catalogitem.ScopedItem), for the item detail builder, and for the CLI item payload.
  • ExtractOptionSpecs reads the range, max_single_selections, per-value maxima, default_value and prerequisite_values.
  • The new package internal/service/itemoptions validates and prices option choices for both surfaces. Defaults apply only to required groups. Wolt also names defaults for optional groups, often a paid extra such as "Add Ingredients: beef +1.50", and the app does not preselect those: a past order line keeps the required salsa default and leaves the optional extra out. A group with prerequisites applies only while one of its prerequisite values is selected. This is common: 410 such groups across six Espoo venues checked, 83 of them required.
  • free_selections (the first N selections free) is 0 on every one of the 1,377 groups checked, so it is not applied.

Live check

Taco Bell Finnoo, "Grilled Cheese Triple Layer Crunchwrap Meal" (16.99 €), with five required groups. wolt cart add --count 2 picked one paid drink, Dr Pepper at +2.00 €, and four defaults filled the rest. Wolt accepted the line, and its basket total was 37.98 €. wolt_cart_add with the same drink merged into that line, taking it to 3 × 18.99 € = 56.97 €. Wolt's checkout preview showed "Item subtotal €56.97". The test line was removed afterwards.

wolt_venue_item on Burger King Finnoo "Ultimate Chili Cheese Plant-based" now returns default_price 13.95 €: 11.45 € plus the required 2.50 € cheddar dip.

…ions in wolt_cart_add

Wolt's assortment keeps a dish's option groups in two places. The item-level
entry carries the dish-specific name, the selection range under
multi_choice_config.total_range and prerequisite_values; the venue library
entry it points at through option_id carries the values, their prices and
default_value.

- payloadutil.JoinOptionLibrary joins the two. catalogitem.ScopedItem and the
  item detail builder use it, so wolt_venue_item (MCP) now returns the values
  instead of empty groups. The CLI item payload uses the same join.
- ExtractOptionSpecs reads multi_choice_config (min, max,
  max_single_selections), per-value maxima, default_value and
  prerequisite_values. required is true when min >= 1; before, every group
  came out as min 0, max 0, not required, in both CLI and MCP.
- Item detail marks the default value, lists prerequisite_value_ids and the
  library_group_id, and adds default_price: the base price plus the defaults
  of the required groups, which is what the Wolt app shows.
- New package itemoptions holds option validation and pricing for both the
  CLI and MCP. A required group left without a choice gets its default value,
  as the Wolt app preselects it (an order history line confirms this); optional
  defaults are never applied, because Wolt names paid extras as defaults. A
  group with prerequisites applies only while one of them is selected.
  Per-value limits are enforced. The applied defaults are reported as
  default_options.
- wolt_cart_add takes options [{group_id, value_id, count}] and prices the
  line with them, replacing the guard that refused every item with a required
  group (which never fired, since no group was ever seen as required).

Checked live on Taco Bell Finnoo: a meal with five required groups added with
one explicit paid drink was accepted; Wolt's basket total and checkout item
subtotal matched the CLI line price, and an MCP add of the same configuration
merged into the line.

Fixes #65
Fixes #66
@mekedron
mekedron merged commit d2d41d1 into main Nov 13, 2026
4 checks passed
@mekedron
mekedron deleted the fix/option-groups-and-mcp-options branch November 13, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant