@chrischall/hellofresh-mcp 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "metadata": {
7
7
  "description": "HelloFresh (US) tools for Claude Code",
8
- "version": "0.2.0"
8
+ "version": "0.3.0"
9
9
  },
10
10
  "plugins": [
11
11
  {
@@ -13,7 +13,7 @@
13
13
  "displayName": "HelloFresh",
14
14
  "source": "./",
15
15
  "description": "Unofficial HelloFresh (US) tools for Claude — subscription, weekly deliveries, menus, meal picks, skips and box sizes via MCP",
16
- "version": "0.2.0",
16
+ "version": "0.3.0",
17
17
  "author": {
18
18
  "name": "Chris Chall"
19
19
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hellofresh",
3
3
  "displayName": "HelloFresh",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "description": "Unofficial HelloFresh (US) tools for Claude — subscription, weekly deliveries, menus, meal picks, skips and box sizes via MCP",
6
6
  "author": {
7
7
  "name": "Chris Chall"
package/README.md CHANGED
@@ -160,7 +160,8 @@ Read tools take `view: compact | full` (default `compact`). A box `price` with `
160
160
  | `hf_list_profiles` | The meal-planner profiles (servings, meals, allowed categories, preferences, premium cap) and where they were loaded from. Local config only. |
161
161
  | `hf_suggest_meals` | Ranked picks for a week and a planner profile (e.g. a 4-person kid-friendly week), skipping recent repeats and recipes you rated 2 or lower, favouring your favourites and varied proteins: the top picks plus 2 alternates per slot, with reasons. Read-only. |
162
162
  | `hf_get_recipe` | One meal's full recipe by week + menu index (protein swaps say which protein they swap in): time, difficulty, allergens, nutrition per serving, ingredient amounts for the week's servings (nearest listed yield otherwise, flagged), plain-text steps, utensils, recipe card PDF and web page. Recipe text is framed as untrusted third-party content. Read-only. |
163
- | `hf_cooking_plan` | A week's picked meals in a recommended cook order — fish, shellfish, other seafood, poultry, ground meat, whole cuts of beef/pork/lamb, vegetarian last; ties by shorter time — each with a suggested day from the delivery date, why, total time, key ingredients and recipe card. Read-only. |
163
+ | `hf_cooking_plan` | A week's picked meals in a recommended cook order — fish, shellfish, other seafood, poultry, ground meat, whole cuts of beef/pork/lamb, vegetarian last; ties by shorter time — each with a suggested day from the delivery date, why, total time, key ingredients, the pantry staples to have on hand and recipe card. Read-only. |
164
+ | `hf_pantry_check` | What to have in the pantry for a week: the staples HelloFresh does not ship (salt, pepper, oil, often butter/eggs/sugar/flour) across the picked meals, summed per ingredient and unit at the week's servings (× quantity; "to taste" when unmeasured), with the dishes using each and a one-line summary. Read-only. |
164
165
  | `hf_weekly_plan` | One read to approve a week: box size needed vs current, suggested picks, the box price for the size it needs (HelloFresh's checkout total + premiums, or a labelled estimate), a one-line summary, and the exact follow-up write calls in order (never a resize of the first box, which keeps its size — see `notes`). Read-only. |
165
166
  | `hf_plan_weeks` | Plan 1–6 weeks at once, each `{week, profile}` (which profile applies to which week is your call — it reads no calendar): each week's `hf_weekly_plan` answer, never suggesting a recipe already planned for an earlier week, a combined summary (one line per week), the total of HelloFresh's own box prices (estimate-only weeks named, not added) and the follow-up writes per week. Skipped weeks are reported as skipped. Read-only. |
166
167
  | `hf_promo_status` | The promo/voucher tracker: coupon code, active, box limit, boxes used (exact for a new account, else assumed — `next_box_number` corrects it) and left, and each upcoming running week's real discount from HelloFresh's price calculator (coupon percent, discount, grand total — or `unavailable` with the reason), with warnings: a running week with no discount, a coupon percent change from the week before, an inactive voucher, fewer than 4 discounted boxes left. Read-only. |
package/dist/bundle.js CHANGED
@@ -73732,6 +73732,7 @@ function projectRecipe(detail, servings) {
73732
73732
  name: i.name.trim(),
73733
73733
  ...typeof a?.amount === "number" ? { amount: a.amount } : {},
73734
73734
  ...a?.unit ? { unit: a.unit } : {},
73735
+ ...!yieldFor ? { amountUnknown: true } : {},
73735
73736
  ...i.shipped === false ? { notInBox: true } : {}
73736
73737
  };
73737
73738
  });
@@ -73798,6 +73799,43 @@ function dayFrom(date5, n) {
73798
73799
  const d = new Date(Date.parse(`${date5}T00:00:00Z`) + n * 864e5);
73799
73800
  return { day: DAYS[d.getUTCDay()], date: d.toISOString().slice(0, 10) };
73800
73801
  }
73802
+ var round2 = (n) => Math.round(n * 100) / 100;
73803
+ var unitKey = (i) => i.unit ?? "";
73804
+ function pantryItems(dishes2) {
73805
+ const lines = /* @__PURE__ */ new Map();
73806
+ for (const dish of dishes2) {
73807
+ for (const i of dish.ingredients) {
73808
+ if (!i.notInBox) continue;
73809
+ const name = i.name.trim();
73810
+ const measured = i.amount !== void 0;
73811
+ const kind = measured ? `=${i.unit ?? ""}` : i.amountUnknown ? "?" : "~";
73812
+ const key = `${name.toLowerCase()}\0${kind}`;
73813
+ const fresh = () => measured ? { name, total: 0, ...i.unit ? { unit: i.unit } : {}, usedIn: [] } : i.amountUnknown ? { name, amountUnknown: true, usedIn: [] } : { name, toTaste: true, usedIn: [] };
73814
+ const line = lines.get(key) ?? lines.set(key, fresh()).get(key);
73815
+ if (measured) line.total = round2(line.total + i.amount * dish.quantity);
73816
+ if (!line.usedIn.includes(dish.name)) line.usedIn.push(dish.name);
73817
+ }
73818
+ }
73819
+ return [...lines.values()].sort(
73820
+ (a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()) || Number(a.toTaste ?? false) - Number(b.toTaste ?? false) || unitKey(a).localeCompare(unitKey(b))
73821
+ );
73822
+ }
73823
+ var UNIT_ABBREVIATIONS = { teaspoon: "tsp", tablespoon: "tbsp", ounce: "oz" };
73824
+ function shortUnit(unit) {
73825
+ const paren = /\(([^()]+)\)\s*$/.exec(unit);
73826
+ if (paren) return paren[1].trim();
73827
+ return UNIT_ABBREVIATIONS[unit.toLowerCase()] ?? unit;
73828
+ }
73829
+ function pantryLine(week, items) {
73830
+ if (items.length === 0) return `Nothing from your pantry for ${week}: HelloFresh ships every ingredient.`;
73831
+ const parts = items.map((i) => {
73832
+ if (i.toTaste) return `${i.name} (to taste)`;
73833
+ if (i.amountUnknown) return `${i.name} (amount not listed)`;
73834
+ const unit = i.unit ? ` ${shortUnit(i.unit)}` : "";
73835
+ return `${i.name} (${i.total}${unit})`;
73836
+ });
73837
+ return `From your pantry for ${week}: ${parts.join(", ")}.`;
73838
+ }
73801
73839
 
73802
73840
  // src/tools/hints.ts
73803
73841
  function foodMeta(intent, extra = {}) {
@@ -74162,7 +74200,7 @@ function registerCookingTools(server, deps2) {
74162
74200
  server.registerTool(
74163
74201
  "hf_cooking_plan",
74164
74202
  {
74165
- description: `Plan cooking for a HelloFresh delivery week: the picked meals in a recommended cook order, most perishable first (fish, then shellfish, other seafood, poultry, ground meat, whole cuts of beef/pork/lamb, vegetarian last; ties by shorter total time), each with a suggested day counted from the delivery date, why, total time, a short ingredient list and the recipe card. ${UNTRUSTED_DESCRIPTION_SUFFIX}`,
74203
+ description: `Plan cooking for a HelloFresh delivery week: the picked meals in a recommended cook order, most perishable first (fish, then shellfish, other seafood, poultry, ground meat, whole cuts of beef/pork/lamb, vegetarian last; ties by shorter total time), each with a suggested day counted from the delivery date, why, total time, a short ingredient list, the pantry staples HelloFresh does not ship (salt, oil\u2026) and the recipe card. ${UNTRUSTED_DESCRIPTION_SUFFIX}`,
74166
74204
  annotations: readOnly("HelloFresh: cooking plan"),
74167
74205
  _meta: foodMeta("whats-on", { aliases: ["what to cook", "cooking order", "dinner this week"] }),
74168
74206
  inputSchema: external_exports.object({ week: weekParam })
@@ -74187,6 +74225,7 @@ function registerCookingTools(server, deps2) {
74187
74225
  const recipe = meal?.recipe ?? {};
74188
74226
  const read = await attempt(async () => projectRecipe(await client.getRecipe(recipeIdOf(meal, s.index, week)), servings));
74189
74227
  const shipped = read.ok ? read.value.ingredients.filter((i) => !i.notInBox).map((i) => i.name) : [];
74228
+ const pantry = read.ok ? read.value.ingredients.filter((i) => i.notInBox).map((i) => i.name) : [];
74190
74229
  const dish = variant ?? base;
74191
74230
  return {
74192
74231
  index: s.index,
@@ -74204,6 +74243,7 @@ function registerCookingTools(server, deps2) {
74204
74243
  ...read.ok ? {
74205
74244
  ingredients: shipped.slice(0, SHORT_INGREDIENTS),
74206
74245
  ...shipped.length > SHORT_INGREDIENTS ? { moreIngredients: shipped.length - SHORT_INGREDIENTS } : {},
74246
+ pantry,
74207
74247
  ...read.value.cardLink ? { cardLink: read.value.cardLink } : {}
74208
74248
  } : { ingredientsError: read.reason }
74209
74249
  };
@@ -74225,6 +74265,67 @@ function registerCookingTools(server, deps2) {
74225
74265
  });
74226
74266
  }
74227
74267
  );
74268
+ server.registerTool(
74269
+ "hf_pantry_check",
74270
+ {
74271
+ description: `Check what to have in the pantry for a HelloFresh delivery week: the staples HelloFresh does NOT ship (salt, pepper, cooking oil, often butter, eggs, sugar or flour) across the week\u2019s picked meals, at the week\u2019s servings (nearest listed yield otherwise, said so) and \xD7 each meal\u2019s quantity \u2014 summed per ingredient and unit, "to taste" when no amount is listed, with the dishes that use each \u2014 plus a one-line summary. Answers "what do I need from my pantry for HelloFresh this week?". ${UNTRUSTED_DESCRIPTION_SUFFIX}`,
74272
+ annotations: readOnly("HelloFresh: pantry check"),
74273
+ _meta: foodMeta("lookup", { aliases: ["pantry check", "pantry staples", "what do i need on hand", "not in the box"] }),
74274
+ inputSchema: external_exports.object({
74275
+ week: weekParam,
74276
+ view: hfView("compact is the summed pantry list and summary; full adds each dish\u2019s staples with their own amounts.")
74277
+ })
74278
+ },
74279
+ async ({ week, view }) => {
74280
+ const account = await loadAccount(client);
74281
+ const delivery = projectDelivery(await client.getDelivery(account.subscriptionId, week));
74282
+ const head = { week, status: delivery.status };
74283
+ if (delivery.status === "skipped") {
74284
+ return fenced({ ...head, items: [], summary: `${week} is skipped: nothing is delivered, so nothing is needed from the pantry.` });
74285
+ }
74286
+ const raw = await readRawMenu(client, account, delivery, week);
74287
+ const menu = projectMenu(raw);
74288
+ if (menu.selected.length === 0) {
74289
+ return fenced({ ...head, items: [], summary: `No meals are picked for ${week} yet \u2014 pick them with hf_select_meals, then check the pantry.` });
74290
+ }
74291
+ const servings = delivery.servings;
74292
+ const reads = await Promise.all(
74293
+ menu.selected.map(async (s) => ({
74294
+ s,
74295
+ read: await attempt(async () => projectRecipe(await client.getRecipe(recipeIdOf(locate(raw, menu, s.index).meal, s.index, week)), servings))
74296
+ }))
74297
+ );
74298
+ const dishes2 = reads.flatMap(({ s, read }) => {
74299
+ if (!read.ok) return [];
74300
+ const name = s.name ?? read.value.name ?? `#${s.index}`;
74301
+ return [{ index: s.index, name, quantity: s.quantity, recipe: read.value }];
74302
+ });
74303
+ const unread = reads.flatMap(({ s, read }) => read.ok ? [] : [{ index: s.index, reason: read.reason }]);
74304
+ const items = pantryItems(dishes2.map((d) => ({ name: d.name, quantity: d.quantity, ingredients: d.recipe.ingredients })));
74305
+ const notes = dishes2.flatMap(
74306
+ (d) => d.recipe.yieldsNote ? [`${d.name === `#${d.index}` ? d.name : `#${d.index} ${d.name}`}: ${d.recipe.yieldsNote}`] : []
74307
+ );
74308
+ const unreadLine = unread.length === 0 ? "" : ` ${unread.length} recipe${unread.length === 1 ? "" : "s"} could not be read (${unread.map((u) => `#${u.index}`).join(", ")}): their staples are missing.`;
74309
+ const full = resolveView(view, HF_VIEWS) === "full";
74310
+ return fenced({
74311
+ ...head,
74312
+ servings,
74313
+ items,
74314
+ summary: pantryLine(week, items) + unreadLine,
74315
+ ...notes.length > 0 ? { notes } : {},
74316
+ ...unread.length > 0 ? { unread } : {},
74317
+ ...full ? {
74318
+ dishes: dishes2.map((d) => ({
74319
+ index: d.index,
74320
+ name: d.name,
74321
+ quantity: d.quantity,
74322
+ ...d.recipe.amountsForServings !== void 0 ? { amountsForServings: d.recipe.amountsForServings } : {},
74323
+ pantry: d.recipe.ingredients.filter((i) => i.notInBox).map(({ notInBox: _n, ...i }) => i)
74324
+ }))
74325
+ } : {}
74326
+ });
74327
+ }
74328
+ );
74228
74329
  }
74229
74330
 
74230
74331
  // src/tools/favorites.ts
@@ -75985,7 +76086,7 @@ var TOOL_REGISTRARS = [
75985
76086
  ];
75986
76087
 
75987
76088
  // src/version.ts
75988
- var VERSION = "0.2.0";
76089
+ var VERSION = "0.3.0";
75989
76090
 
75990
76091
  // src/index.ts
75991
76092
  var bridge = createHelloFreshBridge({ port: readWsPort(), version: VERSION });
package/dist/cooking.js CHANGED
@@ -35,6 +35,7 @@ export function projectRecipe(detail, servings) {
35
35
  name: i.name.trim(),
36
36
  ...(typeof a?.amount === 'number' ? { amount: a.amount } : {}),
37
37
  ...(a?.unit ? { unit: a.unit } : {}),
38
+ ...(!yieldFor ? { amountUnknown: true } : {}),
38
39
  ...(i.shipped === false ? { notInBox: true } : {}),
39
40
  };
40
41
  });
@@ -121,3 +122,58 @@ export function dayFrom(date, n) {
121
122
  const d = new Date(Date.parse(`${date}T00:00:00Z`) + n * 86_400_000);
122
123
  return { day: DAYS[d.getUTCDay()], date: d.toISOString().slice(0, 10) };
123
124
  }
125
+ const round2 = (n) => Math.round(n * 100) / 100;
126
+ const unitKey = (i) => i.unit ?? '';
127
+ /**
128
+ * The not-shipped ingredients across `dishes`, one line per name and unit (amounts
129
+ * summed, × the dish's quantity); a name's unmeasured uses form its own to-taste
130
+ * line. Sorted by name, measured lines before the to-taste one, then by unit.
131
+ */
132
+ export function pantryItems(dishes) {
133
+ const lines = new Map();
134
+ for (const dish of dishes) {
135
+ for (const i of dish.ingredients) {
136
+ if (!i.notInBox)
137
+ continue;
138
+ const name = i.name.trim();
139
+ const measured = i.amount !== undefined;
140
+ const kind = measured ? `=${i.unit ?? ''}` : i.amountUnknown ? '?' : '~';
141
+ const key = `${name.toLowerCase()}\u0000${kind}`;
142
+ const fresh = () => measured
143
+ ? { name, total: 0, ...(i.unit ? { unit: i.unit } : {}), usedIn: [] }
144
+ : i.amountUnknown
145
+ ? { name, amountUnknown: true, usedIn: [] }
146
+ : { name, toTaste: true, usedIn: [] };
147
+ const line = lines.get(key) ?? lines.set(key, fresh()).get(key);
148
+ if (measured)
149
+ line.total = round2(line.total + i.amount * dish.quantity);
150
+ if (!line.usedIn.includes(dish.name))
151
+ line.usedIn.push(dish.name);
152
+ }
153
+ }
154
+ return [...lines.values()].sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()) ||
155
+ Number(a.toTaste ?? false) - Number(b.toTaste ?? false) ||
156
+ unitKey(a).localeCompare(unitKey(b)));
157
+ }
158
+ const UNIT_ABBREVIATIONS = { teaspoon: 'tsp', tablespoon: 'tbsp', ounce: 'oz' };
159
+ /** HelloFresh labels units like "teaspoon (tsp)": prefer the parenthesised short form, then the table. */
160
+ function shortUnit(unit) {
161
+ const paren = /\(([^()]+)\)\s*$/.exec(unit);
162
+ if (paren)
163
+ return paren[1].trim();
164
+ return UNIT_ABBREVIATIONS[unit.toLowerCase()] ?? unit;
165
+ }
166
+ /** The pantry list as one line, e.g. "From your pantry for 2026-W50: Cooking Oil (8 tsp), Salt (to taste)." */
167
+ export function pantryLine(week, items) {
168
+ if (items.length === 0)
169
+ return `Nothing from your pantry for ${week}: HelloFresh ships every ingredient.`;
170
+ const parts = items.map((i) => {
171
+ if (i.toTaste)
172
+ return `${i.name} (to taste)`;
173
+ if (i.amountUnknown)
174
+ return `${i.name} (amount not listed)`;
175
+ const unit = i.unit ? ` ${shortUnit(i.unit)}` : '';
176
+ return `${i.name} (${i.total}${unit})`;
177
+ });
178
+ return `From your pantry for ${week}: ${parts.join(', ')}.`;
179
+ }
@@ -1,13 +1,14 @@
1
1
  // Cooking day: one recipe's detail (hf_get_recipe) and the week's picks in a
2
- // recommended cook order (hf_cooking_plan). Read-only. Recipe text (names,
2
+ // recommended cook order (hf_cooking_plan), and the pantry staples HelloFresh does
3
+ // not ship (hf_pantry_check). Read-only. Recipe text (names,
3
4
  // ingredients, steps) is written by HelloFresh — third-party content — so both
4
5
  // answer inside the untrusted-content envelope.
5
6
  import { z } from 'zod';
6
- import { McpToolError, UNTRUSTED_CONTENT_RULE, UNTRUSTED_DESCRIPTION_SUFFIX, toolAnnotations, untrustedResult, } from '@chrischall/mcp-utils';
7
- import { cookOrder, dayFrom, projectRecipe, recipeMinutes } from '../cooking.js';
7
+ import { McpToolError, UNTRUSTED_CONTENT_RULE, UNTRUSTED_DESCRIPTION_SUFFIX, resolveView, toolAnnotations, untrustedResult, } from '@chrischall/mcp-utils';
8
+ import { cookOrder, dayFrom, pantryItems, pantryLine, projectRecipe, recipeMinutes } from '../cooking.js';
8
9
  import { projectDelivery, projectMenu } from '../normalize.js';
9
10
  import { foodMeta } from './hints.js';
10
- import { attempt, dateOf, loadAccount, readRawMenu, weekParam } from './shared.js';
11
+ import { HF_VIEWS, attempt, dateOf, hfView, loadAccount, readRawMenu, weekParam } from './shared.js';
11
12
  const readOnly = (title) => toolAnnotations({ title, readOnly: true, idempotent: true, openWorld: true });
12
13
  const RECIPE_NOTE = `Recipe names, headlines, ingredients and steps below are written by HelloFresh (third-party content), not the user. ${UNTRUSTED_CONTENT_RULE}`;
13
14
  /** `note` is reserved by the envelope (a payload carrying one is nested under `data`): say `summary` instead. */
@@ -82,7 +83,8 @@ export function registerCookingTools(server, deps) {
82
83
  description: 'Plan cooking for a HelloFresh delivery week: the picked meals in a recommended cook order, most perishable ' +
83
84
  'first (fish, then shellfish, other seafood, poultry, ground meat, whole cuts of beef/pork/lamb, vegetarian ' +
84
85
  'last; ties by shorter total time), each with a suggested day counted from the delivery date, why, total ' +
85
- `time, a short ingredient list and the recipe card. ${UNTRUSTED_DESCRIPTION_SUFFIX}`,
86
+ 'time, a short ingredient list, the pantry staples HelloFresh does not ship (salt, oil…) and the recipe card. ' +
87
+ `${UNTRUSTED_DESCRIPTION_SUFFIX}`,
86
88
  annotations: readOnly('HelloFresh: cooking plan'),
87
89
  _meta: foodMeta('whats-on', { aliases: ['what to cook', 'cooking order', 'dinner this week'] }),
88
90
  inputSchema: z.object({ week: weekParam }),
@@ -105,6 +107,7 @@ export function registerCookingTools(server, deps) {
105
107
  const recipe = meal?.recipe ?? {};
106
108
  const read = await attempt(async () => projectRecipe(await client.getRecipe(recipeIdOf(meal, s.index, week)), servings));
107
109
  const shipped = read.ok ? read.value.ingredients.filter((i) => !i.notInBox).map((i) => i.name) : [];
110
+ const pantry = read.ok ? read.value.ingredients.filter((i) => i.notInBox).map((i) => i.name) : [];
108
111
  const dish = variant ?? base;
109
112
  return {
110
113
  index: s.index,
@@ -125,6 +128,7 @@ export function registerCookingTools(server, deps) {
125
128
  ? {
126
129
  ingredients: shipped.slice(0, SHORT_INGREDIENTS),
127
130
  ...(shipped.length > SHORT_INGREDIENTS ? { moreIngredients: shipped.length - SHORT_INGREDIENTS } : {}),
131
+ pantry,
128
132
  ...(read.value.cardLink ? { cardLink: read.value.cardLink } : {}),
129
133
  }
130
134
  : { ingredientsError: read.reason }),
@@ -147,4 +151,66 @@ export function registerCookingTools(server, deps) {
147
151
  : {}),
148
152
  });
149
153
  });
154
+ server.registerTool('hf_pantry_check', {
155
+ description: 'Check what to have in the pantry for a HelloFresh delivery week: the staples HelloFresh does NOT ship (salt, ' +
156
+ 'pepper, cooking oil, often butter, eggs, sugar or flour) across the week’s picked meals, at the week’s servings ' +
157
+ '(nearest listed yield otherwise, said so) and × each meal’s quantity — summed per ingredient and unit, ' +
158
+ '"to taste" when no amount is listed, with the dishes that use each — plus a one-line summary. Answers ' +
159
+ `"what do I need from my pantry for HelloFresh this week?". ${UNTRUSTED_DESCRIPTION_SUFFIX}`,
160
+ annotations: readOnly('HelloFresh: pantry check'),
161
+ _meta: foodMeta('lookup', { aliases: ['pantry check', 'pantry staples', 'what do i need on hand', 'not in the box'] }),
162
+ inputSchema: z.object({
163
+ week: weekParam,
164
+ view: hfView('compact is the summed pantry list and summary; full adds each dish’s staples with their own amounts.'),
165
+ }),
166
+ }, async ({ week, view }) => {
167
+ const account = await loadAccount(client);
168
+ const delivery = projectDelivery(await client.getDelivery(account.subscriptionId, week));
169
+ const head = { week, status: delivery.status };
170
+ if (delivery.status === 'skipped') {
171
+ return fenced({ ...head, items: [], summary: `${week} is skipped: nothing is delivered, so nothing is needed from the pantry.` });
172
+ }
173
+ const raw = await readRawMenu(client, account, delivery, week);
174
+ const menu = projectMenu(raw);
175
+ if (menu.selected.length === 0) {
176
+ return fenced({ ...head, items: [], summary: `No meals are picked for ${week} yet — pick them with hf_select_meals, then check the pantry.` });
177
+ }
178
+ const servings = delivery.servings; // readRawMenu refuses a week without it
179
+ const reads = await Promise.all(menu.selected.map(async (s) => ({
180
+ s,
181
+ read: await attempt(async () => projectRecipe(await client.getRecipe(recipeIdOf(locate(raw, menu, s.index).meal, s.index, week)), servings)),
182
+ })));
183
+ const dishes = reads.flatMap(({ s, read }) => {
184
+ if (!read.ok)
185
+ return [];
186
+ const name = s.name ?? read.value.name ?? `#${s.index}`;
187
+ return [{ index: s.index, name, quantity: s.quantity, recipe: read.value }];
188
+ });
189
+ const unread = reads.flatMap(({ s, read }) => (read.ok ? [] : [{ index: s.index, reason: read.reason }]));
190
+ const items = pantryItems(dishes.map((d) => ({ name: d.name, quantity: d.quantity, ingredients: d.recipe.ingredients })));
191
+ const notes = dishes.flatMap((d) => d.recipe.yieldsNote ? [`${d.name === `#${d.index}` ? d.name : `#${d.index} ${d.name}`}: ${d.recipe.yieldsNote}`] : []);
192
+ const unreadLine = unread.length === 0
193
+ ? ''
194
+ : ` ${unread.length} recipe${unread.length === 1 ? '' : 's'} could not be read (${unread.map((u) => `#${u.index}`).join(', ')}): their staples are missing.`;
195
+ const full = resolveView(view, HF_VIEWS) === 'full';
196
+ return fenced({
197
+ ...head,
198
+ servings,
199
+ items,
200
+ summary: pantryLine(week, items) + unreadLine,
201
+ ...(notes.length > 0 ? { notes } : {}),
202
+ ...(unread.length > 0 ? { unread } : {}),
203
+ ...(full
204
+ ? {
205
+ dishes: dishes.map((d) => ({
206
+ index: d.index,
207
+ name: d.name,
208
+ quantity: d.quantity,
209
+ ...(d.recipe.amountsForServings !== undefined ? { amountsForServings: d.recipe.amountsForServings } : {}),
210
+ pantry: d.recipe.ingredients.filter((i) => i.notInBox).map(({ notInBox: _n, ...i }) => i),
211
+ })),
212
+ }
213
+ : {}),
214
+ });
215
+ });
150
216
  }
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  // literal below on release; every manifest that carries a version is listed in
3
3
  // release-please-config.json's extra-files and kept in lockstep by
4
4
  // tests/version-sync.test.ts. Keep the release marker on the export line only.
5
- export const VERSION = '0.2.0'; // x-release-please-version
5
+ export const VERSION = '0.3.0'; // x-release-please-version
package/manifest.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifest_version": "0.3",
4
4
  "name": "hellofresh-mcp",
5
5
  "display_name": "HelloFresh",
6
- "version": "0.2.0",
6
+ "version": "0.3.0",
7
7
  "description": "Unofficial HelloFresh (US) tools for Claude — subscription, weekly deliveries, menus, meal picks, skips and box sizes via your signed-in browser",
8
8
  "author": {
9
9
  "name": "Chris Chall",
@@ -167,7 +167,11 @@
167
167
  },
168
168
  {
169
169
  "name": "hf_cooking_plan",
170
- "description": "Order a week's picked meals for cooking, most perishable first (fish, shellfish, ... vegetarian last), with a suggested day, why, time, key ingredients and recipe card; read-only."
170
+ "description": "Order a week's picked meals for cooking, most perishable first (fish, shellfish, ... vegetarian last), with a suggested day, why, time, key ingredients, pantry staples and recipe card; read-only."
171
+ },
172
+ {
173
+ "name": "hf_pantry_check",
174
+ "description": "List the pantry staples HelloFresh does not ship (salt, oil, butter...) for a week's picked meals, summed per ingredient and unit, with a one-line summary; read-only."
171
175
  },
172
176
  {
173
177
  "name": "hf_promo_status",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrischall/hellofresh-mcp",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "license": "MIT",
5
5
  "mcpName": "io.github.chrischall/hellofresh-mcp",
6
6
  "description": "Unofficial HelloFresh (US) MCP server for Claude — subscription, weekly deliveries, menus, meal picks, skips and box sizes — developed and maintained by AI (Claude Code)",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/chrischall/hellofresh-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.2.0",
9
+ "version": "0.3.0",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/hellofresh-mcp",
14
- "version": "0.2.0",
14
+ "version": "0.3.0",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },
@@ -68,7 +68,14 @@ means the browser may be signed out: same remedy.
68
68
  - `hf_cooking_plan` `{week}` — the week's picks in cook order, most perishable
69
69
  first (fish → shellfish → other seafood → poultry → ground meat → beef/pork/lamb
70
70
  → vegetarian; ties by shorter time), each with a suggested day from the
71
- delivery date, why, time and key ingredients.
71
+ delivery date, why, time, key ingredients and `pantry` (the staples to have
72
+ on hand).
73
+ - `hf_pantry_check` `{week, view?}` — what to have in the pantry: the staples
74
+ HelloFresh does NOT ship (salt, pepper, oil, often butter/eggs/sugar/flour)
75
+ across the week's picks, summed per ingredient and unit (× quantity; "to
76
+ taste" when unmeasured) with the dishes using each, and a one-line `summary`
77
+ to pass on. `notes` flags nearest-yield amounts; `unread` names any recipe it
78
+ could not read.
72
79
 
73
80
  Reads take `view`: `compact` (default) is enough to decide; ask for `full` only
74
81
  for a field compact leaves out. Every `price` amount is in US dollars, whatever
@@ -187,7 +194,7 @@ On a host that groups MCPs by context (mcp-host's context groups), every tool
187
194
  but `hf_healthcheck` is in the **food** group, with these intents:
188
195
 
189
196
  - **whats-on** — `hf_list_deliveries`, the group's one canonical read (its `view: "brief"` gives one line per week); `hf_cooking_plan` (not canonical: the week's cook order).
190
- - **lookup** — `hf_get_subscription`, `hf_get_delivery`, `hf_get_menu`, `hf_list_box_sizes`, `hf_recent_picks`, `hf_list_profiles`, `hf_get_recipe`, `hf_list_favorites`, `hf_list_ratings`, `hf_promo_status`.
197
+ - **lookup** — `hf_get_subscription`, `hf_get_delivery`, `hf_get_menu`, `hf_list_box_sizes`, `hf_recent_picks`, `hf_list_profiles`, `hf_get_recipe`, `hf_pantry_check`, `hf_list_favorites`, `hf_list_ratings`, `hf_promo_status`.
191
198
  - **change** — `hf_select_meals`, `hf_set_week_size`, `hf_set_week_delivery_day`, `hf_skip_week`, `hf_unskip_week`, `hf_change_plan_size`, `hf_change_delivery_schedule`, `hf_favorite_recipe`, `hf_unfavorite_recipe`.
192
199
  - **other** — `hf_suggest_meals`, `hf_weekly_plan`, `hf_plan_weeks`.
193
200