@davidwoods/skylight-mcp 0.0.0-stage → 1.7.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.
Files changed (168) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +583 -2
  3. package/THIRD_PARTY_NOTICES.md +38 -0
  4. package/dist/api/auth.d.ts +34 -0
  5. package/dist/api/auth.d.ts.map +1 -0
  6. package/dist/api/auth.js +328 -0
  7. package/dist/api/auth.js.map +1 -0
  8. package/dist/api/client.d.ts +103 -0
  9. package/dist/api/client.d.ts.map +1 -0
  10. package/dist/api/client.js +324 -0
  11. package/dist/api/client.js.map +1 -0
  12. package/dist/api/constants.d.ts +4 -0
  13. package/dist/api/constants.d.ts.map +1 -0
  14. package/dist/api/constants.js +4 -0
  15. package/dist/api/constants.js.map +1 -0
  16. package/dist/api/credential-store.d.ts +38 -0
  17. package/dist/api/credential-store.d.ts.map +1 -0
  18. package/dist/api/credential-store.js +273 -0
  19. package/dist/api/credential-store.js.map +1 -0
  20. package/dist/api/credential-types.d.ts +15 -0
  21. package/dist/api/credential-types.d.ts.map +1 -0
  22. package/dist/api/credential-types.js +11 -0
  23. package/dist/api/credential-types.js.map +1 -0
  24. package/dist/api/endpoints/calendar.d.ts +36 -0
  25. package/dist/api/endpoints/calendar.d.ts.map +1 -0
  26. package/dist/api/endpoints/calendar.js +74 -0
  27. package/dist/api/endpoints/calendar.js.map +1 -0
  28. package/dist/api/endpoints/categories.d.ts +32 -0
  29. package/dist/api/endpoints/categories.d.ts.map +1 -0
  30. package/dist/api/endpoints/categories.js +77 -0
  31. package/dist/api/endpoints/categories.js.map +1 -0
  32. package/dist/api/endpoints/chores.d.ts +50 -0
  33. package/dist/api/endpoints/chores.d.ts.map +1 -0
  34. package/dist/api/endpoints/chores.js +106 -0
  35. package/dist/api/endpoints/chores.js.map +1 -0
  36. package/dist/api/endpoints/devices.d.ts +6 -0
  37. package/dist/api/endpoints/devices.d.ts.map +1 -0
  38. package/dist/api/endpoints/devices.js +10 -0
  39. package/dist/api/endpoints/devices.js.map +1 -0
  40. package/dist/api/endpoints/frames.d.ts +6 -0
  41. package/dist/api/endpoints/frames.d.ts.map +1 -0
  42. package/dist/api/endpoints/frames.js +10 -0
  43. package/dist/api/endpoints/frames.js.map +1 -0
  44. package/dist/api/endpoints/lists.d.ts +55 -0
  45. package/dist/api/endpoints/lists.d.ts.map +1 -0
  46. package/dist/api/endpoints/lists.js +125 -0
  47. package/dist/api/endpoints/lists.js.map +1 -0
  48. package/dist/api/endpoints/meals.d.ts +154 -0
  49. package/dist/api/endpoints/meals.d.ts.map +1 -0
  50. package/dist/api/endpoints/meals.js +194 -0
  51. package/dist/api/endpoints/meals.js.map +1 -0
  52. package/dist/api/endpoints/messages.d.ts +98 -0
  53. package/dist/api/endpoints/messages.d.ts.map +1 -0
  54. package/dist/api/endpoints/messages.js +116 -0
  55. package/dist/api/endpoints/messages.js.map +1 -0
  56. package/dist/api/endpoints/misc.d.ts +27 -0
  57. package/dist/api/endpoints/misc.d.ts.map +1 -0
  58. package/dist/api/endpoints/misc.js +19 -0
  59. package/dist/api/endpoints/misc.js.map +1 -0
  60. package/dist/api/endpoints/photos.d.ts +13 -0
  61. package/dist/api/endpoints/photos.d.ts.map +1 -0
  62. package/dist/api/endpoints/photos.js +10 -0
  63. package/dist/api/endpoints/photos.js.map +1 -0
  64. package/dist/api/endpoints/rewards.d.ts +49 -0
  65. package/dist/api/endpoints/rewards.d.ts.map +1 -0
  66. package/dist/api/endpoints/rewards.js +106 -0
  67. package/dist/api/endpoints/rewards.js.map +1 -0
  68. package/dist/api/endpoints/shape.d.ts +11 -0
  69. package/dist/api/endpoints/shape.d.ts.map +1 -0
  70. package/dist/api/endpoints/shape.js +34 -0
  71. package/dist/api/endpoints/shape.js.map +1 -0
  72. package/dist/api/endpoints/taskbox.d.ts +13 -0
  73. package/dist/api/endpoints/taskbox.d.ts.map +1 -0
  74. package/dist/api/endpoints/taskbox.js +22 -0
  75. package/dist/api/endpoints/taskbox.js.map +1 -0
  76. package/dist/api/oauth.d.ts +62 -0
  77. package/dist/api/oauth.d.ts.map +1 -0
  78. package/dist/api/oauth.js +206 -0
  79. package/dist/api/oauth.js.map +1 -0
  80. package/dist/api/types.d.ts +277 -0
  81. package/dist/api/types.d.ts.map +1 -0
  82. package/dist/api/types.js +5 -0
  83. package/dist/api/types.js.map +1 -0
  84. package/dist/cli.d.ts +23 -0
  85. package/dist/cli.d.ts.map +1 -0
  86. package/dist/cli.js +105 -0
  87. package/dist/cli.js.map +1 -0
  88. package/dist/config.d.ts +27 -0
  89. package/dist/config.d.ts.map +1 -0
  90. package/dist/config.js +78 -0
  91. package/dist/config.js.map +1 -0
  92. package/dist/context.d.ts +17 -0
  93. package/dist/context.d.ts.map +1 -0
  94. package/dist/context.js +17 -0
  95. package/dist/context.js.map +1 -0
  96. package/dist/doctor.d.ts +19 -0
  97. package/dist/doctor.d.ts.map +1 -0
  98. package/dist/doctor.js +109 -0
  99. package/dist/doctor.js.map +1 -0
  100. package/dist/index.d.ts +3 -0
  101. package/dist/index.d.ts.map +1 -0
  102. package/dist/index.js +24 -0
  103. package/dist/index.js.map +1 -0
  104. package/dist/server.d.ts +7 -0
  105. package/dist/server.d.ts.map +1 -0
  106. package/dist/server.js +29 -0
  107. package/dist/server.js.map +1 -0
  108. package/dist/tools/calendar.d.ts +3 -0
  109. package/dist/tools/calendar.d.ts.map +1 -0
  110. package/dist/tools/calendar.js +298 -0
  111. package/dist/tools/calendar.js.map +1 -0
  112. package/dist/tools/chores.d.ts +3 -0
  113. package/dist/tools/chores.d.ts.map +1 -0
  114. package/dist/tools/chores.js +349 -0
  115. package/dist/tools/chores.js.map +1 -0
  116. package/dist/tools/family.d.ts +3 -0
  117. package/dist/tools/family.d.ts.map +1 -0
  118. package/dist/tools/family.js +182 -0
  119. package/dist/tools/family.js.map +1 -0
  120. package/dist/tools/lists.d.ts +3 -0
  121. package/dist/tools/lists.d.ts.map +1 -0
  122. package/dist/tools/lists.js +481 -0
  123. package/dist/tools/lists.js.map +1 -0
  124. package/dist/tools/meals.d.ts +3 -0
  125. package/dist/tools/meals.d.ts.map +1 -0
  126. package/dist/tools/meals.js +491 -0
  127. package/dist/tools/meals.js.map +1 -0
  128. package/dist/tools/messages.d.ts +3 -0
  129. package/dist/tools/messages.d.ts.map +1 -0
  130. package/dist/tools/messages.js +195 -0
  131. package/dist/tools/messages.js.map +1 -0
  132. package/dist/tools/misc.d.ts +3 -0
  133. package/dist/tools/misc.d.ts.map +1 -0
  134. package/dist/tools/misc.js +102 -0
  135. package/dist/tools/misc.js.map +1 -0
  136. package/dist/tools/photos.d.ts +3 -0
  137. package/dist/tools/photos.d.ts.map +1 -0
  138. package/dist/tools/photos.js +42 -0
  139. package/dist/tools/photos.js.map +1 -0
  140. package/dist/tools/planning.d.ts +15 -0
  141. package/dist/tools/planning.d.ts.map +1 -0
  142. package/dist/tools/planning.js +303 -0
  143. package/dist/tools/planning.js.map +1 -0
  144. package/dist/tools/registry.d.ts +39 -0
  145. package/dist/tools/registry.d.ts.map +1 -0
  146. package/dist/tools/registry.js +142 -0
  147. package/dist/tools/registry.js.map +1 -0
  148. package/dist/tools/rewards.d.ts +3 -0
  149. package/dist/tools/rewards.d.ts.map +1 -0
  150. package/dist/tools/rewards.js +339 -0
  151. package/dist/tools/rewards.js.map +1 -0
  152. package/dist/tools/tasks.d.ts +3 -0
  153. package/dist/tools/tasks.d.ts.map +1 -0
  154. package/dist/tools/tasks.js +68 -0
  155. package/dist/tools/tasks.js.map +1 -0
  156. package/dist/utils/dates.d.ts +26 -0
  157. package/dist/utils/dates.d.ts.map +1 -0
  158. package/dist/utils/dates.js +109 -0
  159. package/dist/utils/dates.js.map +1 -0
  160. package/dist/utils/errors.d.ts +45 -0
  161. package/dist/utils/errors.d.ts.map +1 -0
  162. package/dist/utils/errors.js +102 -0
  163. package/dist/utils/errors.js.map +1 -0
  164. package/dist/utils/schedule.d.ts +86 -0
  165. package/dist/utils/schedule.d.ts.map +1 -0
  166. package/dist/utils/schedule.js +189 -0
  167. package/dist/utils/schedule.js.map +1 -0
  168. package/package.json +76 -4
@@ -0,0 +1,491 @@
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";
3
+ import { parseDate, formatDateForDisplay, getTodayDate, getDateOffset } from "../utils/dates.js";
4
+ import { addDays } from "../utils/schedule.js";
5
+ import { formatErrorForMcp } from "../utils/errors.js";
6
+ import { getConfig } from "../config.js";
7
+ export function registerMealTools(server) {
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
+
15
+ Returns: List of meal categories with IDs.`, {}, async () => {
16
+ try {
17
+ const categories = await getMealCategories();
18
+ if (categories.length === 0) {
19
+ return {
20
+ content: [{ type: "text", text: "No meal categories found." }],
21
+ };
22
+ }
23
+ const list = categories
24
+ .map((cat) => `- ${mealCategoryName(cat)} (ID: ${cat.id})`)
25
+ .join("\n");
26
+ return {
27
+ content: [{ type: "text", text: `Meal categories:\n\n${list}` }],
28
+ };
29
+ }
30
+ catch (error) {
31
+ return {
32
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
33
+ isError: true,
34
+ };
35
+ }
36
+ });
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
+
44
+ Returns: List of recipes with their details.`, {}, async () => {
45
+ try {
46
+ const recipes = await getRecipes();
47
+ if (recipes.length === 0) {
48
+ return {
49
+ content: [{ type: "text", text: "No recipes found." }],
50
+ };
51
+ }
52
+ const list = recipes
53
+ .map((recipe) => {
54
+ const parts = [`- ${recipe.attributes.summary ?? "Untitled"} (ID: ${recipe.id})`];
55
+ if (recipe.attributes.description) {
56
+ parts.push(` Description: ${recipe.attributes.description}`);
57
+ }
58
+ return parts.join("\n");
59
+ })
60
+ .join("\n\n");
61
+ return {
62
+ content: [{ type: "text", text: `Recipes:\n\n${list}` }],
63
+ };
64
+ }
65
+ catch (error) {
66
+ return {
67
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
68
+ isError: true,
69
+ };
70
+ }
71
+ });
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
+
78
+ Returns: Recipe details including description.`, {
79
+ recipeId: z.string().describe("ID of the recipe"),
80
+ }, async ({ recipeId }) => {
81
+ try {
82
+ const recipe = await getRecipe(recipeId);
83
+ const parts = [`Recipe: ${recipe.attributes.summary ?? "Untitled"}`];
84
+ for (const [key, value] of Object.entries(recipe.attributes)) {
85
+ if (value !== null && value !== undefined && key !== "summary") {
86
+ parts.push(`${key}: ${value}`);
87
+ }
88
+ }
89
+ return {
90
+ content: [{ type: "text", text: parts.join("\n") }],
91
+ };
92
+ }
93
+ catch (error) {
94
+ return {
95
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
96
+ isError: true,
97
+ };
98
+ }
99
+ });
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
+
112
+ Returns: The created recipe.`, {
113
+ summary: z.string().describe("Recipe name (e.g., 'Spaghetti Bolognese')"),
114
+ description: z.string().optional().describe("Recipe details or instructions"),
115
+ mealCategoryId: z.string().optional().describe("Meal category ID"),
116
+ }, async ({ summary, description, mealCategoryId }) => {
117
+ try {
118
+ const recipe = await createRecipe({ summary, description, mealCategoryId });
119
+ return {
120
+ content: [
121
+ {
122
+ type: "text",
123
+ text: `Created recipe "${summary}" (ID: ${recipe.id})`,
124
+ },
125
+ ],
126
+ };
127
+ }
128
+ catch (error) {
129
+ return {
130
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
131
+ isError: true,
132
+ };
133
+ }
134
+ });
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
+
143
+ Returns: The updated recipe.`, {
144
+ recipeId: z.string().describe("ID of the recipe to update"),
145
+ summary: z.string().optional().describe("New recipe name"),
146
+ description: z.string().nullable().optional().describe("New description"),
147
+ }, async ({ recipeId, summary, description }) => {
148
+ try {
149
+ const updates = {};
150
+ if (summary !== undefined)
151
+ updates.summary = summary;
152
+ if (description !== undefined)
153
+ updates.description = description;
154
+ const recipe = await updateRecipe(recipeId, updates);
155
+ return {
156
+ content: [
157
+ {
158
+ type: "text",
159
+ text: `Updated recipe (ID: ${recipe.id})`,
160
+ },
161
+ ],
162
+ };
163
+ }
164
+ catch (error) {
165
+ return {
166
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
167
+ isError: true,
168
+ };
169
+ }
170
+ });
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
+
177
+ Note: This permanently removes the recipe.`, {
178
+ recipeId: z.string().describe("ID of the recipe to delete"),
179
+ }, async ({ recipeId }) => {
180
+ try {
181
+ await deleteRecipe(recipeId);
182
+ return {
183
+ content: [{ type: "text", text: `Deleted recipe (ID: ${recipeId})` }],
184
+ };
185
+ }
186
+ catch (error) {
187
+ return {
188
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
189
+ isError: true,
190
+ };
191
+ }
192
+ });
193
+ // add_recipe_to_grocery_list tool
194
+ server.tool("add_recipe_to_grocery_list", `Add a recipe's ingredients to the grocery list - Plus subscription required.
195
+
196
+ Use this when:
197
+ - Planning to make a recipe and need to buy ingredients
198
+ - Adding meal ingredients to shopping list
199
+
200
+ Parameters:
201
+ - recipeId (required): ID of the recipe
202
+
203
+ Returns: Confirmation that ingredients were added.`, {
204
+ recipeId: z.string().describe("ID of the recipe"),
205
+ }, async ({ recipeId }) => {
206
+ try {
207
+ await addRecipeToGroceryList(recipeId);
208
+ return {
209
+ content: [
210
+ {
211
+ type: "text",
212
+ text: `Added recipe ingredients to grocery list`,
213
+ },
214
+ ],
215
+ };
216
+ }
217
+ catch (error) {
218
+ return {
219
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
220
+ isError: true,
221
+ };
222
+ }
223
+ });
224
+ // get_meal_sittings tool
225
+ server.tool("get_meal_sittings", `Get scheduled meals for a date range - Plus subscription required.
226
+
227
+ Use this when:
228
+ - Viewing the meal plan for the week
229
+ - Checking what's scheduled for dinner
230
+
231
+ Parameters:
232
+ - date: Start date (defaults to today)
233
+ - dateEnd: End date (defaults to 7 days from start)
234
+
235
+ Returns: List of scheduled meals.`, {
236
+ date: z.string().optional().describe("Start date (YYYY-MM-DD or 'today')"),
237
+ dateEnd: z.string().optional().describe("End date (YYYY-MM-DD)"),
238
+ }, async ({ date, dateEnd }) => {
239
+ try {
240
+ const config = getConfig();
241
+ const startDate = date ? parseDate(date, config.timezone) : getTodayDate(config.timezone);
242
+ const endDate = dateEnd ? parseDate(dateEnd, config.timezone) : getDateOffset(7, config.timezone);
243
+ const sittings = await getMealSittings({
244
+ dateMin: startDate,
245
+ // Skylight's date_max leaves out the end day (a one-day query returns nothing),
246
+ // so ask for one day more; the loop below drops anything past endDate.
247
+ dateMax: addDays(endDate, 1),
248
+ });
249
+ if (sittings.length === 0) {
250
+ return {
251
+ content: [
252
+ {
253
+ type: "text",
254
+ text: `No meals scheduled for ${formatDateForDisplay(startDate)} to ${formatDateForDisplay(endDate)}.`,
255
+ },
256
+ ],
257
+ };
258
+ }
259
+ // Resolve category ids to names once; recipes are shown by id (fetch with get_recipe).
260
+ const categories = await getMealCategories().catch(() => []);
261
+ const categoryName = new Map(categories.map((c) => [c.id, mealCategoryName(c)]));
262
+ const rows = [];
263
+ for (const sitting of sittings) {
264
+ const dates = sitting.attributes.instances?.length
265
+ ? sitting.attributes.instances
266
+ : [sitting.attributes.date ?? "unknown date"];
267
+ const categoryId = sitting.relationships?.meal_category?.data?.id;
268
+ const category = categoryId ? (categoryName.get(categoryId) ?? `category ${categoryId}`) : "uncategorised";
269
+ const recipeId = sitting.relationships?.meal_recipe?.data?.id;
270
+ const what = sitting.attributes.summary?.trim() || (recipeId ? `recipe ${recipeId}` : "(empty)");
271
+ for (const d of dates) {
272
+ if (d < startDate || d > endDate)
273
+ continue;
274
+ rows.push({
275
+ date: d,
276
+ line: `- ${formatDateForDisplay(d)} ${category}: ${what}${recipeId ? ` (recipe ID: ${recipeId})` : ""} [sitting ID: ${sitting.id}]`,
277
+ });
278
+ }
279
+ }
280
+ rows.sort((a, b) => a.date.localeCompare(b.date));
281
+ const list = rows.map((r) => r.line).join("\n");
282
+ return {
283
+ content: [{ type: "text", text: `Scheduled meals:\n\n${list}` }],
284
+ };
285
+ }
286
+ catch (error) {
287
+ return {
288
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
289
+ isError: true,
290
+ };
291
+ }
292
+ });
293
+ // create_meal_sitting tool
294
+ server.tool("create_meal_sitting", `Schedule a meal for a specific date - Plus subscription required.
295
+
296
+ Use this when:
297
+ - Planning meals for the week
298
+ - Scheduling a recipe for dinner
299
+
300
+ Parameters:
301
+ - date (required): Date for the meal (YYYY-MM-DD)
302
+ - mealCategoryId (required): Meal category ID (use get_meal_categories to find "Dinner" etc.)
303
+ - summary: What the meal is, as free text, e.g. "Thai green curry". No recipe needed.
304
+ - recipeId: A saved recipe to link instead of, or as well as, a summary.
305
+
306
+ Give at least one of summary or recipeId.
307
+
308
+ Returns: The created meal sitting.`, {
309
+ date: z.string().describe("Date for the meal (YYYY-MM-DD or 'today', 'tomorrow')"),
310
+ mealCategoryId: z.string().describe("Meal category ID (e.g., ID for 'Dinner')"),
311
+ summary: z.string().max(200).optional().describe("Meal name as free text, e.g. 'Sheet-pan fajitas'"),
312
+ recipeId: z.string().optional().describe("Saved recipe ID to link"),
313
+ }, async ({ date, mealCategoryId, summary, recipeId }) => {
314
+ try {
315
+ if (!summary?.trim() && !recipeId) {
316
+ return {
317
+ content: [{ type: "text", text: "Give a summary (meal name) or a recipeId." }],
318
+ isError: true,
319
+ };
320
+ }
321
+ const config = getConfig();
322
+ const mealDate = parseDate(date, config.timezone);
323
+ const sitting = await createMealSitting({
324
+ date: mealDate,
325
+ mealCategoryId,
326
+ summary: summary?.trim() || undefined,
327
+ recipeId,
328
+ });
329
+ const what = sitting.attributes.summary?.trim() || summary?.trim() || `recipe ${recipeId}`;
330
+ return {
331
+ content: [
332
+ {
333
+ type: "text",
334
+ text: `Scheduled "${what}" for ${formatDateForDisplay(mealDate)} (sitting ID: ${sitting.id})`,
335
+ },
336
+ ],
337
+ };
338
+ }
339
+ catch (error) {
340
+ return {
341
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
342
+ isError: true,
343
+ };
344
+ }
345
+ });
346
+ // update_meal_sitting tool
347
+ server.tool("update_meal_sitting", `Edit or move a scheduled meal - Plus subscription required.
348
+
349
+ Use this when:
350
+ - Renaming a planned meal, or changing its note or category
351
+ - Moving a meal to another day
352
+
353
+ Parameters:
354
+ - sittingId (required): from get_meal_sittings
355
+ - date (required): the meal's CURRENT date (YYYY-MM-DD), also from get_meal_sittings
356
+ - newDate: move the meal to this date
357
+ - summary: new meal name
358
+ - note: new note
359
+ - mealCategoryId: move to another meal category (use get_meal_categories)
360
+
361
+ Give at least one change. Only one-off meals can be edited here; repeating meals
362
+ must be edited in the Skylight app.
363
+
364
+ Returns: What changed.`, {
365
+ sittingId: z.string().describe("Sitting ID from get_meal_sittings"),
366
+ date: z.string().describe("The meal's current date (YYYY-MM-DD)"),
367
+ newDate: z.string().optional().describe("Move the meal to this date (YYYY-MM-DD or 'tomorrow')"),
368
+ summary: z.string().max(200).optional().describe("New meal name"),
369
+ note: z.string().max(500).optional().describe("New note"),
370
+ mealCategoryId: z.string().optional().describe("New meal category ID"),
371
+ }, async ({ sittingId, date, newDate, summary, note, mealCategoryId }) => {
372
+ try {
373
+ if (newDate === undefined && summary === undefined && note === undefined && mealCategoryId === undefined) {
374
+ return {
375
+ content: [{ type: "text", text: "Nothing to change. Give newDate, summary, note or mealCategoryId." }],
376
+ isError: true,
377
+ };
378
+ }
379
+ if (summary !== undefined && !summary.trim()) {
380
+ return { content: [{ type: "text", text: "summary cannot be empty." }], isError: true };
381
+ }
382
+ const config = getConfig();
383
+ const current = parseDate(date, config.timezone);
384
+ const target = newDate ? parseDate(newDate, config.timezone) : undefined;
385
+ const existing = await findMealSitting(sittingId, current);
386
+ if (!existing) {
387
+ return {
388
+ content: [
389
+ {
390
+ type: "text",
391
+ text: `No meal with sitting ID ${sittingId} on ${formatDateForDisplay(current)}. Check get_meal_sittings for the ID and its current date.`,
392
+ },
393
+ ],
394
+ isError: true,
395
+ };
396
+ }
397
+ const was = existing.attributes.summary?.trim() || "(no name)";
398
+ await updateMealSitting({
399
+ existing,
400
+ date: current,
401
+ newDate: target,
402
+ summary: summary?.trim(),
403
+ note,
404
+ mealCategoryId,
405
+ });
406
+ const changes = [];
407
+ if (summary !== undefined)
408
+ changes.push(`renamed "${was}" to "${summary.trim()}"`);
409
+ if (target && target !== current)
410
+ changes.push(`moved from ${formatDateForDisplay(current)} to ${formatDateForDisplay(target)}`);
411
+ if (note !== undefined)
412
+ changes.push("note updated");
413
+ if (mealCategoryId !== undefined)
414
+ changes.push(`category set to ${mealCategoryId}`);
415
+ return {
416
+ content: [{ type: "text", text: `Updated meal (sitting ID: ${sittingId}): ${changes.join("; ")}.` }],
417
+ };
418
+ }
419
+ catch (error) {
420
+ return {
421
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
422
+ isError: true,
423
+ };
424
+ }
425
+ });
426
+ // delete_meal_sitting tool
427
+ server.tool("delete_meal_sitting", `Delete a scheduled meal - Plus subscription required. THIS CANNOT BE UNDONE.
428
+
429
+ Use this when:
430
+ - Removing a meal that was planned by mistake or is no longer happening
431
+
432
+ Parameters:
433
+ - sittingId (required): from get_meal_sittings
434
+ - date (required): the meal's date (YYYY-MM-DD)
435
+ - confirm: must be true to delete. Without it nothing is deleted and the meal that would be removed is shown.
436
+
437
+ Only one-off meals can be deleted here; repeating meals must be handled in the Skylight app.
438
+
439
+ Returns: Confirmation that Skylight removed the meal.`, {
440
+ sittingId: z.string().describe("Sitting ID from get_meal_sittings"),
441
+ date: z.string().describe("The meal's date (YYYY-MM-DD)"),
442
+ confirm: z.boolean().optional().describe("Set true to actually delete. Default: preview only."),
443
+ }, async ({ sittingId, date, confirm }) => {
444
+ try {
445
+ const config = getConfig();
446
+ const day = parseDate(date, config.timezone);
447
+ const existing = await findMealSitting(sittingId, day);
448
+ if (!existing) {
449
+ return {
450
+ content: [
451
+ {
452
+ type: "text",
453
+ text: `No meal with sitting ID ${sittingId} on ${formatDateForDisplay(day)}. Nothing deleted.`,
454
+ },
455
+ ],
456
+ isError: true,
457
+ };
458
+ }
459
+ const what = existing.attributes.summary?.trim() || "(no name)";
460
+ if (confirm !== true) {
461
+ return {
462
+ content: [
463
+ {
464
+ type: "text",
465
+ text: `NOT DELETED. This would permanently delete "${what}" on ${formatDateForDisplay(day)} (sitting ID: ${sittingId}). Call again with confirm: true to proceed.`,
466
+ },
467
+ ],
468
+ };
469
+ }
470
+ const removed = await deleteMealSitting(existing, day);
471
+ return {
472
+ content: [
473
+ {
474
+ type: "text",
475
+ text: removed
476
+ ? `Deleted "${what}" on ${formatDateForDisplay(day)} (sitting ID: ${sittingId}).`
477
+ : `Skylight accepted the request but did not confirm the removal of sitting ${sittingId}. Check get_meal_sittings.`,
478
+ },
479
+ ],
480
+ ...(removed ? {} : { isError: true }),
481
+ };
482
+ }
483
+ catch (error) {
484
+ return {
485
+ content: [{ type: "text", text: formatErrorForMcp(error) }],
486
+ isError: true,
487
+ };
488
+ }
489
+ });
490
+ }
491
+ //# sourceMappingURL=meals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meals.js","sourceRoot":"","sources":["../../src/tools/meals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,2BAA2B;IAC3B,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB;;;;;;2CAMuC,EACvC,EAAE,EACF,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,iBAAiB,EAAE,CAAC;YAE7C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC5B,OAAO;oBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC;iBACxE,CAAC;YACJ,CAAC;YAED,MAAM,IAAI,GAAG,UAAU;iBACpB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,gBAAgB,CAAC,GA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O,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,+CAA+C,IAAI,QAAQ,oBAAoB,CAAC,GAAG,CAAC,iBAAiB,SAAS,8CAA8C;yBACnK;qBACF;iBACF,CAAC;YACJ,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;YACvD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,OAAO;4BACX,CAAC,CAAC,YAAY,IAAI,QAAQ,oBAAoB,CAAC,GAAG,CAAC,iBAAiB,SAAS,IAAI;4BACjF,CAAC,CAAC,4EAA4E,SAAS,4BAA4B;qBACtH;iBACF;gBACD,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;aACtC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;gBACpE,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerMessageTools(server: McpServer): void;
3
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/tools/messages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASzE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4L5D"}