| name | grocery-api |
| description | Use the local groc HTTP API to search Sainsbury's groceries, search favourites, add/update/remove basket items, and view basket. Use when this capability is needed. |
| metadata | {"author":"abracadabra50"} |
Grocery API Skill
Use this skill when the user asks about Sainsbury's groceries, favourites, searching products, adding/updating/removing basket items, or viewing the basket.
The local API must already be running on port 7876:
GROC_API_PORT=7876 npm run api
Commands
Run from the repo root:
node skills/api/wrapper.js fav-search "milk"
node skills/api/wrapper.js search "milk"
node skills/api/wrapper.js favourites
node skills/api/wrapper.js basket
node skills/api/wrapper.js add <product-id> [qty]
node skills/api/wrapper.js remove <item-id>
node skills/api/wrapper.js update <item-id> <qty>
All commands return JSON from the local API.
Add-to-basket workflow
When the user asks to add an item to the basket:
-
First search favourites:
node skills/api/wrapper.js fav-search "USER ITEM"
-
If there is a clear favourite result that matches the user's intent, add it directly:
node skills/api/wrapper.js add <product-id> [qty]
-
If there are multiple plausible favourite results, ask the user which one to add. Include names, prices, and product IDs.