HomeStock
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| HOMESTOCK_DB | No | Path to the SQLite database file. Defaults to ./homestock.db if not set. | ./homestock.db |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| add_itemsA | Record a purchase (one receipt). Idempotent per (source_ref, line_no). Each item: {name, quantity, unit, price?, category?, line_no}. source, and whether purchased_at is required: 'email' a receipt email — REQUIRED, the receipt carries a date 'photo' a photographed receipt — REQUIRED, the paper carries a date 'loyalty' a Clubcard/Nectar export — REQUIRED, the export carries a date 'barcode' scanned in the shop — optional, defaults to today 'manual' typed by the user — optional, defaults to today Only the two "happening right now" doors may default. Dating an old paper receipt or a three-year loyalty export as today would silently corrupt the repurchase intervals that every estimate is derived from. source_ref: retailer ORDER ID where extractable, else email Message-ID; manual fallback 'manual:::' (+':2' suffix on collision — a nonzero 'ignored' count on a fresh receipt signals one). Call get_stock() first and reuse existing item names exactly. Returns {inserted, ignored, rejected: [{line_no, reason}]}. |
| get_stockA | Current stock estimate. No argument: list all known items as {name, category} — call this before add_items to reuse exact names. With an item name: naive-baseline estimate with raw provenance (estimated_state is 'unknown' below 2 distinct purchase dates). |
| what_should_i_orderA | The shopping list. Two ways onto it:
Sorted by overshoot ratio, highest first. |
| void_eventA | Correction path: void matching event lines (all lines of the receipt if line_no omitted). Voided rows are excluded from every estimate; re-inserting a corrected line for the same (source_ref, line_no) then works. Returns {voided: n}; zero matches is a no-op, not an error. |
| record_ingest_runA | Ingestion agent plumbing: record a run (heartbeat + audit) after every ingestion pass, even one that wrote nothing. skipped: [{source_ref, reason}] for receipts/lines the agent could not parse (never guess — skip and log). Returns the backfill cursor: earliest_window_start already covered. |
| get_eventsA | Read-only raw event access (explainability: every estimate is recomputable from these rows). Includes voided rows, flagged. Oldest first. Scope with limit: 1..1000, default 200. offset: page forward from there. Returns {events: [...], returned, offset, total, has_more}. |
| correct_stockA | Ground truth from the user: what they can actually see. Use it whenever the user volunteers stock in conversation ("we're out of milk", "still got two bags of rice"). The item must already be known — stock is inferred from purchases, so record the receipt first. |
| discard_itemA | Record waste — food thrown away. Two uses: it removes the item from stock, and it is the only signal that a shelf-life estimate was too generous. Distinct from correct_stock, which says what is left. |
| set_shelf_lifeA | Teach HomeStock how long an item keeps, so it can be flagged before it rots. The agent supplies a sensible default on first purchase (fresh chicken ~3 days, milk ~7); the user overrides it. storage is one of pantry/fridge/freezer and is advisory — it explains the number. |
| get_expiring_soonB | Perishables at or past their estimated use-by, soonest first. Only items with a shelf life set and at least one purchase. Two exclusions keep this list honest rather than merely long: items the user has confirmed are gone (they cannot spoil), and items expired for longer than their own shelf life again — a chicken ten days past a three-day use-by was eaten or binned a week ago, and nagging about it is how a list stops being read. |
| merge_itemsA | Fix name drift: fold every event on Merging is irreversible in one step but loses nothing: the events survive under the surviving name, and get_events() still shows them. |
| get_healthA | Diagnostics: is HomeStock actually working? Counts and timestamps only — never item names, never email content — so the output is safe to paste into a bug report.
|
| add_aliasB | Teach HomeStock that a raw string means an item it already knows. Four input paths produce four vocabularies for one thing: a barcode gives "tesco british semi skimmed milk 2.27l", a receipt line gives "tesco semi skmd milk", a person types "milk". Without this they become three items with three wrong repurchase cycles. Resolve a name once and record it here rather than resolving it on every ingest. |
| list_aliasesA | Every learned name mapping, or just one item's. Useful for spotting canonicalisation going wrong before it poisons the estimates. |
| add_captureA | Put something in the inbox to be read later: a photographed paper receipt, a scanned barcode, or a typed note ("2 milk, bread, 6 eggs"). Capture and reading are deliberately separate. Capturing must work instantly, offline, one-handed, in a shop — reading needs a model. This is how a phone can contribute to a database it cannot reason about. Photos are stored as files (see path); the row records where. Nothing here is stock yet: an agent calls list_captures(), reads it, calls add_items(), then resolve_capture(). |
| list_capturesA | The inbox: things captured from any device and not yet turned into items. Read each one, call add_items() with what it contains, then resolve_capture(). Pass status='done' or 'skipped' to review history. |
| resolve_captureA | Close a capture once its contents are recorded — or mark it 'skipped' with a note when it cannot be read. Never guess at a blurry receipt; an unreadable capture that is honestly skipped is recoverable, a fabricated one is not. |
| check_recipeA | Can I cook this? Sorts a recipe's ingredients into what you have, what is running low, and what you would need to buy. The model turns a recipe — pasted text, a URL, a photo of a cookbook — into this list of ingredient names. The server only does the set maths against stock, because that is the part that must be exactly right. |
| consume_itemsA | Record cooking. Each item: {name, quantity?, unit?, finished?}. Cooking is the largest real depletion event in a kitchen and nothing else
models it — without this, stock only ever drains by inference. Set
|
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| onboarding | First run: consent, backfill the user's receipt history, and give them the pantry reveal. Follow this before any ingestion. |
| ingestion | The scheduled ingestion procedure: which emails to read, how to record them, and the rules that keep it from guessing. Run this on a schedule, or as catch-up before answering questions about stock. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| recipes_index | Retailers HomeStock knows how to read, and nothing else is ever read. Each name resolves at homestock://recipes/{retailer}. |
TDQS
Scored across 19 tools
Most tools target clearly distinct resources and actions (purchase, cook, waste, manual correction are four separate inventory movements, each described against the others). The closest pairs are correct_stock vs consume_items(finished:true) and merge_items vs add_alias, but the descriptions explicitly delineate those boundaries, leaving little genuine misselection risk.
Nearly all tools follow a verb_noun pattern (add_items, get_stock, correct_stock, discard_item, resolve_capture, check_recipe). The lone outlier is the question-form what_should_i_order, and noun number is mixed (add_items vs discard_item), but the convention is overwhelmingly readable and predictable.
At 19 tools this sits at the heavy end, but the domain genuinely spans purchases, stock, expiry, captures, aliases, recipes, diagnostics, and ingestion plumbing, so nearly every tool covers a distinct lifecycle stage. A few could arguably be folded (list_aliases, get_health) but none feel redundant filler.
Coverage is broad: ingest, correct, void, merge, consume, discard, alias, capture, expiry, recipe, and diagnostics form a near-complete lifecycle with explicit correction paths. The main gap is no way to delete/forget an item entirely from the catalog (merge only folds duplicates), and no direct edit of past purchase lines beyond void+re-add.