Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
HOMESTOCK_DBNoPath 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

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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:

  • The user said they were out (correct_stock(item, 0)) — ranked first, because an observation beats an estimate.

  • Inference: >= 3 distinct purchase dates, past the median repurchase interval, excluding items past 3x median (presumed discontinued).

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 item and since (ISO-8601 UTC, YYYY-MM-DD) rather than paging the whole log: a few years of receipts is well over a hundred thousand rows, which no context window will hold.

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. quantity=0 means "we're out". A correction outranks the interval model and resets the estimate's clock, so this is the one call that makes an estimate right rather than merely plausible.

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 from_item into into_item and delete the duplicate. Canonicalisation is the agent's job, so duplicates ("milk" vs "semi-skimmed milk") are a matter of when, not if — without this the only remedy is hand-editing SQLite.

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.

stale is the one that matters. Ingestion failing silently (expired mail auth, a retailer changing template) looks exactly like a quiet week, and the product's whole claim is that its answers can be trusted.

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 finished: true for anything you used the last of; that also records a correction to zero, which is what actually moves it onto the shopping list. Unknown items are reported, not invented.

Prompts

Interactive templates invoked by user choice

NameDescription
onboardingFirst run: consent, backfill the user's receipt history, and give them the pantry reveal. Follow this before any ingestion.
ingestionThe 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

NameDescription
recipes_indexRetailers HomeStock knows how to read, and nothing else is ever read. Each name resolves at homestock://recipes/{retailer}.

TDQS

A3.7/5.0

Scored across 19 tools

Disambiguation4/5

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.

Naming Consistency4/5

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.

Tool Count4/5

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.

Completeness4/5

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.

Maintenance

ActivityStale
ResponsivenessNo recent community issues