Repository navigation
Description
wolt_venue_item (and the menu items) return every option group with values: [], min: 0, max: 0 and required: false. The CLI's wolt venue item returns the values for the same item, but its min/max/required are also wrong.
Repro (no login needed), on any restaurant item that has option groups, ideally one with a required single-choice group:
wolt_venue_item venue=<venue-slug> item_id=<item-id>
- MCP: every group has empty
values,min: 0,max: 0,required: false. Same with and without a logged-in profile. - CLI (
wolt venue item <venue-slug> <item-id> --format json): the groups have their values, but stillmin: 0,max: 0,required: false.
I left out the real venue and item on purpose. I can share them privately if you need them to reproduce this.
What the catalog actually sends (POST .../assortment/items with that item id):
{
"items": [{
"id": "<item-id>",
"price": <base-price>,
"options": [{
"id": "<item-option-id>",
"option_id": "<library-option-id>",
"name": "<group name>",
"multi_choice_config": { "total_range": { "min": 1, "max": 1 } }
}]
}],
"options": [{
"id": "<library-option-id>",
"type": "choice",
"default_value": "<value-id>",
"values": [{ "id": "<value-id>", "name": "<value name>", "price": <option-price> }]
}]
}- The item's
options[]entries carry the range undermulti_choice_config.total_range, not as top-levelmin/max. - Each item option points to a root
options[]library entry byoption_id. The library entry holds thevaluesand adefault_value.
payloadutil.ExtractOptionSpecs reads min/minimum/min_select and max/maximum/max_select at the top level of the group (payloadutil.go:640-645), so every range comes out as 0 and nothing is required. The MCP handler (handleVenueItem, tools_venue.go:582) also never joins the item option's option_id to the library entry. The CLI gets the values because resolveVenueItemPayloadBySlug merges the full venue assortment (buildItemPayloadFromAssortment), but that code lives in internal/cli, which the MCP server doesn't import.
Effects:
- MCP clients see no option values, so they can't choose or price options.
- An item whose price depends on a required option shows only its base price. When a required group (
min: 1) has a single value priced<option-price>, the real price is<base-price> + <option-price>, which is what the Wolt app shows; the tools show<base-price>. - The guard in
wolt_cart_addthat refuses items with required options (tools_cart.go:267-276) never fires, because no group is ever seen as required. Such an item is added withoptions: []at its base price.
Suggested fix:
- In
ExtractOptionSpecs, readmulti_choice_config.total_range.min/maxand treatmin >= 1as required. - Join item options to the root library by
option_id, and carrydefault_valuethrough as adefaultflag on the value. - Share the assortment merge between the CLI and the MCP item handler, for example by moving
buildItemPayloadFromAssortmentinto a service package. - Optionally return an effective price: base price plus the default values of required groups.
Happy to send a PR for this if you'd take one.
Activity
mekedron commentedon Nov 13, 2026
Thanks for the detailed report — fixed in v2.6.0 (#69).
wolt_venue_itemandwolt venue itemnow join each item-level group to its library entry, readmulti_choice_config.total_range, mark the default value, listprerequisite_value_ids, and adddefault_price(base price plus the defaults of the required groups).mekedron commentedon Nov 13, 2026
@terranalon thanks for the offer of a PR, and for the very precise pointers (
payloadutil.go,tools_venue.go, theoption_idjoin). They made this quick to fix, so no PR needed this time.One thing beyond your suggestions:
prerequisite_valuesturned out to matter a lot. Many required groups (meal deals especially) apply only after a value of another group is chosen. The item output now lists them asprerequisite_value_ids, and validation ignores such a group until its prerequisite is selected.If you still have the venue you left out of the report, please try v2.6.0 on it. If anything still looks off, reopen this or file a new issue.
terranalon commentedon Nov 14, 2026
Thanks for the quick fix. I tried v2.6.0 on the venue from the report. Values, min/max/required,
prerequisite_value_ids,default_priceand theoptionsargument onwolt_cart_addall match what the Wolt web app shows.One small thing left:
wolt_venue_itemmarksdefault: trueon values in optional groups too (min: 0). On one item, four optional groups (two removals and two paid extras) each had a value flagged as default. The web app preselects only the defaults of required groups, so all four come up unchecked there, and the app's price equalsdefault_price.The cause is in
extractOptionGroups(internal/service/observability/items.go:228), which flags the library'sdefault_valuewhatever the group's minimum.itemoptions.Buildapplies a default only whenminimum(spec) == 1and the group is active, which is right, so baskets anddefault_pricearen't affected. The risk is an agent reading the flags as "the usual order" and passing them towolt_cart_add, which would add the paid extras and the removals.Suggested fix: set
default: trueonly when the group's minimum is at least 1, the same conditionBuilduses.