@davidwoods/skylight-mcp 1.8.2 → 1.8.5

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.
Files changed (41) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +637 -636
  3. package/THIRD_PARTY_NOTICES.md +38 -38
  4. package/dist/api/endpoints/chores.d.ts +42 -0
  5. package/dist/api/endpoints/chores.d.ts.map +1 -1
  6. package/dist/api/endpoints/chores.js +61 -0
  7. package/dist/api/endpoints/chores.js.map +1 -1
  8. package/dist/api/endpoints/meals.d.ts +20 -3
  9. package/dist/api/endpoints/meals.d.ts.map +1 -1
  10. package/dist/api/endpoints/meals.js +68 -10
  11. package/dist/api/endpoints/meals.js.map +1 -1
  12. package/dist/cli.js +5 -5
  13. package/dist/config.js +23 -23
  14. package/dist/tools/calendar.d.ts.map +1 -1
  15. package/dist/tools/calendar.js +59 -57
  16. package/dist/tools/calendar.js.map +1 -1
  17. package/dist/tools/chores.d.ts.map +1 -1
  18. package/dist/tools/chores.js +181 -62
  19. package/dist/tools/chores.js.map +1 -1
  20. package/dist/tools/family.js +17 -17
  21. package/dist/tools/lists.js +87 -87
  22. package/dist/tools/meals.d.ts.map +1 -1
  23. package/dist/tools/meals.js +135 -110
  24. package/dist/tools/meals.js.map +1 -1
  25. package/dist/tools/messages.js +32 -32
  26. package/dist/tools/misc.js +14 -14
  27. package/dist/tools/photos.js +6 -6
  28. package/dist/tools/planning.js +18 -18
  29. package/dist/tools/registry.d.ts.map +1 -1
  30. package/dist/tools/registry.js +1 -0
  31. package/dist/tools/registry.js.map +1 -1
  32. package/dist/tools/rewards.d.ts.map +1 -1
  33. package/dist/tools/rewards.js +75 -74
  34. package/dist/tools/rewards.js.map +1 -1
  35. package/dist/tools/tasks.js +13 -13
  36. package/dist/utils/errors.js +16 -16
  37. package/dist/utils/redact.d.ts +9 -0
  38. package/dist/utils/redact.d.ts.map +1 -0
  39. package/dist/utils/redact.js +24 -0
  40. package/dist/utils/redact.js.map +1 -0
  41. package/package.json +78 -78
@@ -27,9 +27,9 @@ async function resolveListId(listId, listName, defaultToGrocery = false) {
27
27
  }
28
28
  export function registerListTools(server) {
29
29
  // get_lists tool
30
- server.tool("get_lists", `Get all lists from Skylight (grocery lists, to-do lists, etc.).
31
-
32
- Use this to see what lists are available before adding items.
30
+ server.tool("get_lists", `Get all lists from Skylight (grocery lists, to-do lists, etc.).
31
+
32
+ Use this to see what lists are available before adding items.
33
33
  Returns list names, types (shopping/to_do), and item counts.`, {}, async () => {
34
34
  try {
35
35
  const lists = await getLists();
@@ -80,13 +80,13 @@ Returns list names, types (shopping/to_do), and item counts.`, {}, async () => {
80
80
  }
81
81
  });
82
82
  // get_list_items tool
83
- server.tool("get_list_items", `Get items from a specific Skylight list.
84
-
85
- Use this to answer:
86
- - "What's on the grocery list?"
87
- - "Show me my to-do list"
88
- - "What items are on [list name]?"
89
-
83
+ server.tool("get_list_items", `Get items from a specific Skylight list.
84
+
85
+ Use this to answer:
86
+ - "What's on the grocery list?"
87
+ - "Show me my to-do list"
88
+ - "What items are on [list name]?"
89
+
90
90
  Returns items organized by section with their completion status.`, {
91
91
  listName: z
92
92
  .string()
@@ -219,17 +219,17 @@ Returns items organized by section with their completion status.`, {
219
219
  }
220
220
  });
221
221
  // create_list tool
222
- server.tool("create_list", `Create a new list in Skylight.
223
-
224
- Use this when:
225
- - Creating a new shopping/grocery list
226
- - Creating a new to-do list
227
-
228
- Parameters:
229
- - label (required): Name of the list (e.g., "Vacation Packing", "Weekly Groceries")
230
- - kind (required): "shopping" for grocery/shopping lists, "to_do" for task lists
231
- - color: Optional color for the list
232
-
222
+ server.tool("create_list", `Create a new list in Skylight.
223
+
224
+ Use this when:
225
+ - Creating a new shopping/grocery list
226
+ - Creating a new to-do list
227
+
228
+ Parameters:
229
+ - label (required): Name of the list (e.g., "Vacation Packing", "Weekly Groceries")
230
+ - kind (required): "shopping" for grocery/shopping lists, "to_do" for task lists
231
+ - color: Optional color for the list
232
+
233
233
  Returns: The created list details.`, {
234
234
  label: z.string().describe("Name of the list (e.g., 'Vacation Packing')"),
235
235
  kind: z.enum(["shopping", "to_do"]).describe("Type of list: 'shopping' or 'to_do'"),
@@ -254,19 +254,19 @@ Returns: The created list details.`, {
254
254
  }
255
255
  });
256
256
  // update_list tool
257
- server.tool("update_list", `Update an existing list's name or settings.
258
-
259
- Use this when:
260
- - Renaming a list
261
- - Changing a list's type or color
262
-
263
- Parameters:
264
- - listId: ID of the list to update (use get_lists to find IDs)
265
- - listName: Name of the list to update (alternative to listId)
266
- - label: New name for the list
267
- - kind: New type ("shopping" or "to_do")
268
- - color: New color for the list
269
-
257
+ server.tool("update_list", `Update an existing list's name or settings.
258
+
259
+ Use this when:
260
+ - Renaming a list
261
+ - Changing a list's type or color
262
+
263
+ Parameters:
264
+ - listId: ID of the list to update (use get_lists to find IDs)
265
+ - listName: Name of the list to update (alternative to listId)
266
+ - label: New name for the list
267
+ - kind: New type ("shopping" or "to_do")
268
+ - color: New color for the list
269
+
270
270
  Returns: The updated list details.`, {
271
271
  listId: z.string().optional().describe("ID of the list to update"),
272
272
  listName: z.string().optional().describe("Name of the list to update (alternative to listId)"),
@@ -307,17 +307,17 @@ Returns: The updated list details.`, {
307
307
  }
308
308
  });
309
309
  // delete_list tool
310
- server.tool("delete_list", `Delete a list from Skylight.
311
-
312
- Use this when:
313
- - Removing an old or unused list
314
- - Deleting a temporary list
315
-
316
- Parameters:
317
- - listId: ID of the list to delete (use get_lists to find IDs)
318
- - listName: Name of the list to delete (alternative to listId)
319
- - confirm: must be true to delete; without it nothing is deleted and a preview is returned.
320
-
310
+ server.tool("delete_list", `Delete a list from Skylight.
311
+
312
+ Use this when:
313
+ - Removing an old or unused list
314
+ - Deleting a temporary list
315
+
316
+ Parameters:
317
+ - listId: ID of the list to delete (use get_lists to find IDs)
318
+ - listName: Name of the list to delete (alternative to listId)
319
+ - confirm: must be true to delete; without it nothing is deleted and a preview is returned.
320
+
321
321
  Note: This permanently deletes the list and all its items.`, {
322
322
  listId: z.string().optional().describe("ID of the list to delete"),
323
323
  listName: z.string().optional().describe("Name of the list to delete (alternative to listId)"),
@@ -354,23 +354,23 @@ Note: This permanently deletes the list and all its items.`, {
354
354
  }
355
355
  });
356
356
  // create_list_item tool
357
- server.tool("create_list_item", `Add an item to a Skylight list.
358
-
359
- Use this when:
360
- - Adding something to the grocery list: "Add milk to the shopping list"
361
- - Creating a to-do item: "Put 'call doctor' on my to-do list"
362
- - Adding items to any list
363
-
364
- Parameters:
365
- - label (required): The item text (e.g., "Milk", "Call doctor")
366
- - listId: ID of the list to add to
367
- - listName: Name of the list to add to (e.g., "Grocery List")
368
- - section: Category within the list (e.g., "Dairy", "Produce")
369
-
370
- If no list is specified, adds to the default grocery list.
371
-
372
- Returns: Confirmation of the added item.
373
-
357
+ server.tool("create_list_item", `Add an item to a Skylight list.
358
+
359
+ Use this when:
360
+ - Adding something to the grocery list: "Add milk to the shopping list"
361
+ - Creating a to-do item: "Put 'call doctor' on my to-do list"
362
+ - Adding items to any list
363
+
364
+ Parameters:
365
+ - label (required): The item text (e.g., "Milk", "Call doctor")
366
+ - listId: ID of the list to add to
367
+ - listName: Name of the list to add to (e.g., "Grocery List")
368
+ - section: Category within the list (e.g., "Dairy", "Produce")
369
+
370
+ If no list is specified, adds to the default grocery list.
371
+
372
+ Returns: Confirmation of the added item.
373
+
374
374
  Related: Use get_lists to see available lists and their IDs.`, {
375
375
  label: z.string().describe("The item text to add (e.g., 'Milk', 'Call doctor')"),
376
376
  listId: z.string().optional().describe("ID of the list to add to"),
@@ -404,20 +404,20 @@ Related: Use get_lists to see available lists and their IDs.`, {
404
404
  }
405
405
  });
406
406
  // update_list_item tool
407
- server.tool("update_list_item", `Update a list item (mark complete, rename, move to section).
408
-
409
- Use this when:
410
- - Marking an item as complete: "Check off milk from the list"
411
- - Renaming an item: "Change 'milk' to '2% milk'"
412
- - Moving an item to a different section
413
-
414
- Parameters:
415
- - itemId (required): ID of the item to update
416
- - listId (required): ID of the list containing the item
417
- - label: New text for the item
418
- - status: "completed" to check off, "pending" to uncheck
419
- - section: Move to a different section
420
-
407
+ server.tool("update_list_item", `Update a list item (mark complete, rename, move to section).
408
+
409
+ Use this when:
410
+ - Marking an item as complete: "Check off milk from the list"
411
+ - Renaming an item: "Change 'milk' to '2% milk'"
412
+ - Moving an item to a different section
413
+
414
+ Parameters:
415
+ - itemId (required): ID of the item to update
416
+ - listId (required): ID of the list containing the item
417
+ - label: New text for the item
418
+ - status: "completed" to check off, "pending" to uncheck
419
+ - section: Move to a different section
420
+
421
421
  Returns: The updated item details.`, {
422
422
  itemId: z.string().describe("ID of the item to update"),
423
423
  listId: z.string().describe("ID of the list containing the item"),
@@ -452,17 +452,17 @@ Returns: The updated item details.`, {
452
452
  }
453
453
  });
454
454
  // delete_list_item tool
455
- server.tool("delete_list_item", `Remove an item from a list.
456
-
457
- Use this when:
458
- - Removing an item that was added by mistake
459
- - Deleting an item instead of marking it complete
460
-
461
- Parameters:
462
- - itemId (required): ID of the item to delete
463
- - listId (required): ID of the list containing the item
464
- - confirm: must be true to delete; without it nothing is deleted and a preview is returned.
465
-
455
+ server.tool("delete_list_item", `Remove an item from a list.
456
+
457
+ Use this when:
458
+ - Removing an item that was added by mistake
459
+ - Deleting an item instead of marking it complete
460
+
461
+ Parameters:
462
+ - itemId (required): ID of the item to delete
463
+ - listId (required): ID of the list containing the item
464
+ - confirm: must be true to delete; without it nothing is deleted and a preview is returned.
465
+
466
466
  Note: This permanently removes the item. Use update_list_item with status="completed" to check it off instead.`, {
467
467
  itemId: z.string().describe("ID of the item to delete"),
468
468
  listId: z.string().describe("ID of the list containing the item"),
@@ -1 +1 @@
1
- {"version":3,"file":"meals.d.ts","sourceRoot":"","sources":["../../src/tools/meals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAsBzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4iBzD"}
1
+ {"version":3,"file":"meals.d.ts","sourceRoot":"","sources":["../../src/tools/meals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAwBzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAskBzD"}
@@ -1,17 +1,17 @@
1
1
  import { z } from "zod";
2
- import { mealCategoryName, getMealCategories, getRecipes, getRecipe, createRecipe, updateRecipe, deleteRecipe, addRecipeToGroceryList, getMealSittings, createMealSitting, findMealSitting, updateMealSitting, deleteMealSitting, } from "../api/endpoints/meals.js";
2
+ import { mealCategoryName, getMealCategories, getRecipes, getRecipe, createRecipe, updateRecipe, deleteRecipe, addRecipeToGroceryList, getMealSittings, createMealSitting, findMealSitting, updateMealSitting, deleteMealSitting, mealKind, } from "../api/endpoints/meals.js";
3
3
  import { parseDate, formatDateForDisplay, getTodayDate, getDateOffset } from "../utils/dates.js";
4
4
  import { addDays } from "../utils/schedule.js";
5
5
  import { formatErrorForMcp } from "../utils/errors.js";
6
6
  import { getConfig } from "../config.js";
7
7
  export function registerMealTools(server) {
8
8
  // get_meal_categories tool
9
- server.tool("get_meal_categories", `Get meal categories (Breakfast, Lunch, Dinner, etc.) - Plus subscription required.
10
-
11
- Use this when:
12
- - Finding category IDs for scheduling meals
13
- - Seeing what meal times are available
14
-
9
+ server.tool("get_meal_categories", `Get meal categories (Breakfast, Lunch, Dinner, etc.) - Plus subscription required.
10
+
11
+ Use this when:
12
+ - Finding category IDs for scheduling meals
13
+ - Seeing what meal times are available
14
+
15
15
  Returns: List of meal categories with IDs.`, {}, async () => {
16
16
  try {
17
17
  const categories = await getMealCategories();
@@ -35,12 +35,12 @@ Returns: List of meal categories with IDs.`, {}, async () => {
35
35
  }
36
36
  });
37
37
  // get_recipes tool
38
- server.tool("get_recipes", `Get all saved recipes - Plus subscription required.
39
-
40
- Use this when:
41
- - Browsing available recipes
42
- - Finding a recipe ID for meal planning
43
-
38
+ server.tool("get_recipes", `Get all saved recipes - Plus subscription required.
39
+
40
+ Use this when:
41
+ - Browsing available recipes
42
+ - Finding a recipe ID for meal planning
43
+
44
44
  Returns: List of recipes with their details.`, {}, async () => {
45
45
  try {
46
46
  const recipes = await getRecipes();
@@ -70,11 +70,11 @@ Returns: List of recipes with their details.`, {}, async () => {
70
70
  }
71
71
  });
72
72
  // get_recipe tool
73
- server.tool("get_recipe", `Get details for a specific recipe - Plus subscription required.
74
-
75
- Parameters:
76
- - recipeId (required): ID of the recipe
77
-
73
+ server.tool("get_recipe", `Get details for a specific recipe - Plus subscription required.
74
+
75
+ Parameters:
76
+ - recipeId (required): ID of the recipe
77
+
78
78
  Returns: Recipe details including description.`, {
79
79
  recipeId: z.string().describe("ID of the recipe"),
80
80
  }, async ({ recipeId }) => {
@@ -98,17 +98,17 @@ Returns: Recipe details including description.`, {
98
98
  }
99
99
  });
100
100
  // create_recipe tool
101
- server.tool("create_recipe", `Create a new recipe - Plus subscription required.
102
-
103
- Use this when:
104
- - Adding a new family recipe
105
- - Saving a meal for meal planning
106
-
107
- Parameters:
108
- - summary (required): Recipe name
109
- - description: Recipe details or instructions
110
- - mealCategoryId: Category ID (use get_meal_categories)
111
-
101
+ server.tool("create_recipe", `Create a new recipe - Plus subscription required.
102
+
103
+ Use this when:
104
+ - Adding a new family recipe
105
+ - Saving a meal for meal planning
106
+
107
+ Parameters:
108
+ - summary (required): Recipe name
109
+ - description: Recipe details or instructions
110
+ - mealCategoryId: Category ID (use get_meal_categories)
111
+
112
112
  Returns: The created recipe.`, {
113
113
  summary: z.string().describe("Recipe name (e.g., 'Spaghetti Bolognese')"),
114
114
  description: z.string().optional().describe("Recipe details or instructions"),
@@ -133,13 +133,13 @@ Returns: The created recipe.`, {
133
133
  }
134
134
  });
135
135
  // update_recipe tool
136
- server.tool("update_recipe", `Update an existing recipe - Plus subscription required.
137
-
138
- Parameters:
139
- - recipeId (required): ID of the recipe
140
- - summary: New name
141
- - description: New description
142
-
136
+ server.tool("update_recipe", `Update an existing recipe - Plus subscription required.
137
+
138
+ Parameters:
139
+ - recipeId (required): ID of the recipe
140
+ - summary: New name
141
+ - description: New description
142
+
143
143
  Returns: The updated recipe.`, {
144
144
  recipeId: z.string().describe("ID of the recipe to update"),
145
145
  summary: z.string().optional().describe("New recipe name"),
@@ -169,12 +169,12 @@ Returns: The updated recipe.`, {
169
169
  }
170
170
  });
171
171
  // delete_recipe tool
172
- server.tool("delete_recipe", `Delete a recipe - Plus subscription required.
173
-
174
- Parameters:
175
- - recipeId (required): ID of the recipe to delete
176
- - confirm: must be true to delete; without it nothing is deleted and a preview is returned.
177
-
172
+ server.tool("delete_recipe", `Delete a recipe - Plus subscription required.
173
+
174
+ Parameters:
175
+ - recipeId (required): ID of the recipe to delete
176
+ - confirm: must be true to delete; without it nothing is deleted and a preview is returned.
177
+
178
178
  Note: This permanently removes the recipe.`, {
179
179
  recipeId: z.string().describe("ID of the recipe to delete"),
180
180
  confirm: z.boolean().optional().default(false).describe("Must be true to delete; otherwise only a preview is returned"),
@@ -198,15 +198,15 @@ Note: This permanently removes the recipe.`, {
198
198
  }
199
199
  });
200
200
  // add_recipe_to_grocery_list tool
201
- server.tool("add_recipe_to_grocery_list", `Add a recipe's ingredients to the grocery list - Plus subscription required.
202
-
203
- Use this when:
204
- - Planning to make a recipe and need to buy ingredients
205
- - Adding meal ingredients to shopping list
206
-
207
- Parameters:
208
- - recipeId (required): ID of the recipe
209
-
201
+ server.tool("add_recipe_to_grocery_list", `Add a recipe's ingredients to the grocery list - Plus subscription required.
202
+
203
+ Use this when:
204
+ - Planning to make a recipe and need to buy ingredients
205
+ - Adding meal ingredients to shopping list
206
+
207
+ Parameters:
208
+ - recipeId (required): ID of the recipe
209
+
210
210
  Returns: Confirmation that ingredients were added.`, {
211
211
  recipeId: z.string().describe("ID of the recipe"),
212
212
  }, async ({ recipeId }) => {
@@ -229,16 +229,16 @@ Returns: Confirmation that ingredients were added.`, {
229
229
  }
230
230
  });
231
231
  // get_meal_sittings tool
232
- server.tool("get_meal_sittings", `Get scheduled meals for a date range - Plus subscription required.
233
-
234
- Use this when:
235
- - Viewing the meal plan for the week
236
- - Checking what's scheduled for dinner
237
-
238
- Parameters:
239
- - date: Start date (defaults to today)
240
- - dateEnd: End date (defaults to 7 days from start)
241
-
232
+ server.tool("get_meal_sittings", `Get scheduled meals for a date range - Plus subscription required.
233
+
234
+ Use this when:
235
+ - Viewing the meal plan for the week
236
+ - Checking what's scheduled for dinner
237
+
238
+ Parameters:
239
+ - date: Start date (defaults to today)
240
+ - dateEnd: End date (defaults to 7 days from start)
241
+
242
242
  Returns: List of scheduled meals.`, {
243
243
  date: z.string().optional().describe("Start date (YYYY-MM-DD or 'today')"),
244
244
  dateEnd: z.string().optional().describe("End date (YYYY-MM-DD)"),
@@ -298,26 +298,28 @@ Returns: List of scheduled meals.`, {
298
298
  }
299
299
  });
300
300
  // create_meal_sitting tool
301
- server.tool("create_meal_sitting", `Schedule a meal for a specific date - Plus subscription required.
302
-
303
- Use this when:
304
- - Planning meals for the week
305
- - Scheduling a recipe for dinner
306
-
307
- Parameters:
308
- - date (required): Date for the meal (YYYY-MM-DD)
309
- - mealCategoryId (required): Meal category ID (use get_meal_categories to find "Dinner" etc.)
310
- - summary: What the meal is, as free text, e.g. "Thai green curry". No recipe needed.
311
- - recipeId: A saved recipe to link instead of, or as well as, a summary.
312
-
313
- Give at least one of summary or recipeId.
314
-
301
+ server.tool("create_meal_sitting", `Schedule a meal for a specific date - Plus subscription required.
302
+
303
+ Use this when:
304
+ - Planning meals for the week
305
+ - Scheduling a recipe for dinner
306
+
307
+ Parameters:
308
+ - date (required): Date for the meal (YYYY-MM-DD)
309
+ - mealCategoryId (required): Meal category ID (use get_meal_categories to find "Dinner" etc.)
310
+ - summary: What the meal is, as free text, e.g. "Thai green curry". No recipe needed.
311
+ - recipeId: A saved recipe to link instead of, or as well as, a summary.
312
+ - repeat: "weekly" makes it repeat every week on the same weekday as date, with no end.
313
+
314
+ Give at least one of summary or recipeId.
315
+
315
316
  Returns: The created meal sitting.`, {
316
317
  date: z.string().describe("Date for the meal (YYYY-MM-DD or 'today', 'tomorrow')"),
317
318
  mealCategoryId: z.string().describe("Meal category ID (e.g., ID for 'Dinner')"),
318
319
  summary: z.string().max(200).optional().describe("Meal name as free text, e.g. 'Sheet-pan fajitas'"),
319
320
  recipeId: z.string().optional().describe("Saved recipe ID to link"),
320
- }, async ({ date, mealCategoryId, summary, recipeId }) => {
321
+ repeat: z.enum(["weekly"]).optional().describe("Repeat every week on date's weekday, no end date"),
322
+ }, async ({ date, mealCategoryId, summary, recipeId, repeat }) => {
321
323
  try {
322
324
  if (!summary?.trim() && !recipeId) {
323
325
  return {
@@ -332,13 +334,14 @@ Returns: The created meal sitting.`, {
332
334
  mealCategoryId,
333
335
  summary: summary?.trim() || undefined,
334
336
  recipeId,
337
+ repeat,
335
338
  });
336
339
  const what = sitting.attributes.summary?.trim() || summary?.trim() || `recipe ${recipeId}`;
337
340
  return {
338
341
  content: [
339
342
  {
340
343
  type: "text",
341
- text: `Scheduled "${what}" for ${formatDateForDisplay(mealDate)} (sitting ID: ${sitting.id})`,
344
+ text: `Scheduled "${what}" for ${formatDateForDisplay(mealDate)}${repeat ? ", repeating weekly" : ""} (sitting ID: ${sitting.id})`,
342
345
  },
343
346
  ],
344
347
  };
@@ -351,23 +354,23 @@ Returns: The created meal sitting.`, {
351
354
  }
352
355
  });
353
356
  // update_meal_sitting tool
354
- server.tool("update_meal_sitting", `Edit or move a scheduled meal - Plus subscription required.
355
-
356
- Use this when:
357
- - Renaming a planned meal, or changing its note or category
358
- - Moving a meal to another day
359
-
360
- Parameters:
361
- - sittingId (required): from get_meal_sittings
362
- - date (required): the meal's CURRENT date (YYYY-MM-DD), also from get_meal_sittings
363
- - newDate: move the meal to this date
364
- - summary: new meal name
365
- - note: new note
366
- - mealCategoryId: move to another meal category (use get_meal_categories)
367
-
368
- Give at least one change. Only one-off meals can be edited here; repeating meals
369
- must be edited in the Skylight app.
370
-
357
+ server.tool("update_meal_sitting", `Edit or move a scheduled meal - Plus subscription required.
358
+
359
+ Use this when:
360
+ - Renaming a planned meal, or changing its note or category
361
+ - Moving a meal to another day
362
+
363
+ Parameters:
364
+ - sittingId (required): from get_meal_sittings
365
+ - date (required): the meal's CURRENT date (YYYY-MM-DD), also from get_meal_sittings
366
+ - newDate: move the meal to this date
367
+ - summary: new meal name
368
+ - note: new note
369
+ - mealCategoryId: move to another meal category (use get_meal_categories)
370
+
371
+ Give at least one change. Only one-off meals can be edited here; repeating meals
372
+ must be edited in the Skylight app.
373
+
371
374
  Returns: What changed.`, {
372
375
  sittingId: z.string().describe("Sitting ID from get_meal_sittings"),
373
376
  date: z.string().describe("The meal's current date (YYYY-MM-DD)"),
@@ -431,23 +434,25 @@ Returns: What changed.`, {
431
434
  }
432
435
  });
433
436
  // delete_meal_sitting tool
434
- server.tool("delete_meal_sitting", `Delete a scheduled meal - Plus subscription required. THIS CANNOT BE UNDONE.
435
-
436
- Use this when:
437
- - Removing a meal that was planned by mistake or is no longer happening
438
-
439
- Parameters:
440
- - sittingId (required): from get_meal_sittings
441
- - date (required): the meal's date (YYYY-MM-DD)
442
- - confirm: must be true to delete. Without it nothing is deleted and the meal that would be removed is shown.
443
-
444
- Only one-off meals can be deleted here; repeating meals must be handled in the Skylight app.
445
-
437
+ server.tool("delete_meal_sitting", `Delete a scheduled meal - Plus subscription required. THIS CANNOT BE UNDONE.
438
+
439
+ Use this when:
440
+ - Removing a meal that was planned by mistake or is no longer happening
441
+
442
+ Parameters:
443
+ - sittingId (required): from get_meal_sittings
444
+ - date (required): the meal's date (YYYY-MM-DD)
445
+ - scope: for a repeating meal only. "one" (default) removes just that date; "future" removes that date and every later one, keeping earlier ones; "all" removes the whole series, past dates included.
446
+ - confirm: must be true to delete. Without it nothing is deleted and what would be removed is shown.
447
+
448
+ A meal that was edited on its own after being part of a series cannot be deleted here; use the Skylight app.
449
+
446
450
  Returns: Confirmation that Skylight removed the meal.`, {
447
451
  sittingId: z.string().describe("Sitting ID from get_meal_sittings"),
448
452
  date: z.string().describe("The meal's date (YYYY-MM-DD)"),
453
+ scope: z.enum(["one", "future", "all"]).optional().describe("Repeating meals only: one (default), future, or all"),
449
454
  confirm: z.boolean().optional().describe("Set true to actually delete. Default: preview only."),
450
- }, async ({ sittingId, date, confirm }) => {
455
+ }, async ({ sittingId, date, scope, confirm }) => {
451
456
  try {
452
457
  const config = getConfig();
453
458
  const day = parseDate(date, config.timezone);
@@ -464,23 +469,43 @@ Returns: Confirmation that Skylight removed the meal.`, {
464
469
  };
465
470
  }
466
471
  const what = existing.attributes.summary?.trim() || "(no name)";
472
+ const kind = mealKind(existing);
473
+ if (kind === "detached") {
474
+ return {
475
+ content: [
476
+ {
477
+ type: "text",
478
+ text: `"${what}" on ${formatDateForDisplay(day)} was edited on its own and is detached from its series. It cannot be deleted here; use the Skylight app. Nothing deleted.`,
479
+ },
480
+ ],
481
+ isError: true,
482
+ };
483
+ }
484
+ const chosen = scope ?? "one";
485
+ const effect = kind === "one-off"
486
+ ? `permanently delete "${what}" on ${formatDateForDisplay(day)}`
487
+ : chosen === "one"
488
+ ? `permanently delete only the ${formatDateForDisplay(day)} occurrence of the repeating meal "${what}"; the series continues`
489
+ : chosen === "future"
490
+ ? `permanently delete "${what}" on ${formatDateForDisplay(day)} and every later occurrence; earlier occurrences are kept`
491
+ : `permanently delete the ENTIRE repeating series "${what}", every occurrence including past ones`;
467
492
  if (confirm !== true) {
468
493
  return {
469
494
  content: [
470
495
  {
471
496
  type: "text",
472
- text: `NOT DELETED. This would permanently delete "${what}" on ${formatDateForDisplay(day)} (sitting ID: ${sittingId}). Call again with confirm: true to proceed.`,
497
+ text: `NOT DELETED. This would ${effect} (sitting ID: ${sittingId}). Call again with confirm: true to proceed.`,
473
498
  },
474
499
  ],
475
500
  };
476
501
  }
477
- const removed = await deleteMealSitting(existing, day);
502
+ const removed = await deleteMealSitting(existing, day, chosen);
478
503
  return {
479
504
  content: [
480
505
  {
481
506
  type: "text",
482
507
  text: removed
483
- ? `Deleted "${what}" on ${formatDateForDisplay(day)} (sitting ID: ${sittingId}).`
508
+ ? `Deleted ${kind === "one-off" ? `"${what}" on ${formatDateForDisplay(day)}` : chosen === "all" ? `the whole series "${what}"` : chosen === "future" ? `"${what}" from ${formatDateForDisplay(day)} onward` : `the ${formatDateForDisplay(day)} occurrence of "${what}"`} (sitting ID: ${sittingId}).`
484
509
  : `Skylight accepted the request but did not confirm the removal of sitting ${sittingId}. Check get_meal_sittings.`,
485
510
  },
486
511
  ],