@bmhall2/skylight-mcp 1.1.7
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.
- package/LICENSE +21 -0
- package/README.md +265 -0
- package/dist/api/auth.d.ts +38 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +62 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/client.d.ts +84 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +228 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/endpoints/calendar.d.ts +33 -0
- package/dist/api/endpoints/calendar.d.ts.map +1 -0
- package/dist/api/endpoints/calendar.js +60 -0
- package/dist/api/endpoints/calendar.js.map +1 -0
- package/dist/api/endpoints/categories.d.ts +23 -0
- package/dist/api/endpoints/categories.d.ts.map +1 -0
- package/dist/api/endpoints/categories.js +48 -0
- package/dist/api/endpoints/categories.js.map +1 -0
- package/dist/api/endpoints/chores.d.ts +50 -0
- package/dist/api/endpoints/chores.d.ts.map +1 -0
- package/dist/api/endpoints/chores.js +106 -0
- package/dist/api/endpoints/chores.js.map +1 -0
- package/dist/api/endpoints/devices.d.ts +6 -0
- package/dist/api/endpoints/devices.d.ts.map +1 -0
- package/dist/api/endpoints/devices.js +10 -0
- package/dist/api/endpoints/devices.js.map +1 -0
- package/dist/api/endpoints/frames.d.ts +6 -0
- package/dist/api/endpoints/frames.d.ts.map +1 -0
- package/dist/api/endpoints/frames.js +10 -0
- package/dist/api/endpoints/frames.js.map +1 -0
- package/dist/api/endpoints/lists.d.ts +55 -0
- package/dist/api/endpoints/lists.d.ts.map +1 -0
- package/dist/api/endpoints/lists.js +125 -0
- package/dist/api/endpoints/lists.js.map +1 -0
- package/dist/api/endpoints/meals.d.ts +102 -0
- package/dist/api/endpoints/meals.d.ts.map +1 -0
- package/dist/api/endpoints/meals.js +100 -0
- package/dist/api/endpoints/meals.js.map +1 -0
- package/dist/api/endpoints/misc.d.ts +27 -0
- package/dist/api/endpoints/misc.d.ts.map +1 -0
- package/dist/api/endpoints/misc.js +18 -0
- package/dist/api/endpoints/misc.js.map +1 -0
- package/dist/api/endpoints/photos.d.ts +13 -0
- package/dist/api/endpoints/photos.d.ts.map +1 -0
- package/dist/api/endpoints/photos.js +10 -0
- package/dist/api/endpoints/photos.js.map +1 -0
- package/dist/api/endpoints/rewards.d.ts +49 -0
- package/dist/api/endpoints/rewards.d.ts.map +1 -0
- package/dist/api/endpoints/rewards.js +105 -0
- package/dist/api/endpoints/rewards.js.map +1 -0
- package/dist/api/endpoints/taskbox.d.ts +13 -0
- package/dist/api/endpoints/taskbox.d.ts.map +1 -0
- package/dist/api/endpoints/taskbox.js +22 -0
- package/dist/api/endpoints/taskbox.js.map +1 -0
- package/dist/api/generated-types.d.ts +18967 -0
- package/dist/api/generated-types.d.ts.map +1 -0
- package/dist/api/generated-types.js +6 -0
- package/dist/api/generated-types.js.map +1 -0
- package/dist/api/types.d.ts +283 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +5 -0
- package/dist/api/types.js.map +1 -0
- package/dist/config.d.ts +52 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +80 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +48 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/calendar.d.ts +3 -0
- package/dist/tools/calendar.d.ts.map +1 -0
- package/dist/tools/calendar.js +297 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/chores.d.ts +3 -0
- package/dist/tools/chores.d.ts.map +1 -0
- package/dist/tools/chores.js +349 -0
- package/dist/tools/chores.js.map +1 -0
- package/dist/tools/family.d.ts +3 -0
- package/dist/tools/family.d.ts.map +1 -0
- package/dist/tools/family.js +182 -0
- package/dist/tools/family.js.map +1 -0
- package/dist/tools/lists.d.ts +3 -0
- package/dist/tools/lists.d.ts.map +1 -0
- package/dist/tools/lists.js +481 -0
- package/dist/tools/lists.js.map +1 -0
- package/dist/tools/meals.d.ts +3 -0
- package/dist/tools/meals.d.ts.map +1 -0
- package/dist/tools/meals.js +319 -0
- package/dist/tools/meals.js.map +1 -0
- package/dist/tools/misc.d.ts +3 -0
- package/dist/tools/misc.d.ts.map +1 -0
- package/dist/tools/misc.js +101 -0
- package/dist/tools/misc.js.map +1 -0
- package/dist/tools/photos.d.ts +3 -0
- package/dist/tools/photos.d.ts.map +1 -0
- package/dist/tools/photos.js +42 -0
- package/dist/tools/photos.js.map +1 -0
- package/dist/tools/rewards.d.ts +3 -0
- package/dist/tools/rewards.d.ts.map +1 -0
- package/dist/tools/rewards.js +338 -0
- package/dist/tools/rewards.js.map +1 -0
- package/dist/tools/tasks.d.ts +3 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +68 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/utils/dates.d.ts +26 -0
- package/dist/utils/dates.d.ts.map +1 -0
- package/dist/utils/dates.js +109 -0
- package/dist/utils/dates.js.map +1 -0
- package/dist/utils/errors.d.ts +45 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +102 -0
- package/dist/utils/errors.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getMealCategories, getRecipes, getRecipe, createRecipe, updateRecipe, deleteRecipe, addRecipeToGroceryList, getMealSittings, createMealSitting, } from "../api/endpoints/meals.js";
|
|
3
|
+
import { parseDate, formatDateForDisplay, getTodayDate, getDateOffset } from "../utils/dates.js";
|
|
4
|
+
import { formatErrorForMcp } from "../utils/errors.js";
|
|
5
|
+
import { getConfig } from "../config.js";
|
|
6
|
+
export function registerMealTools(server) {
|
|
7
|
+
// get_meal_categories tool
|
|
8
|
+
server.tool("get_meal_categories", `Get meal categories (Breakfast, Lunch, Dinner, etc.) - Plus subscription required.
|
|
9
|
+
|
|
10
|
+
Use this when:
|
|
11
|
+
- Finding category IDs for scheduling meals
|
|
12
|
+
- Seeing what meal times are available
|
|
13
|
+
|
|
14
|
+
Returns: List of meal categories with IDs.`, {}, async () => {
|
|
15
|
+
try {
|
|
16
|
+
const categories = await getMealCategories();
|
|
17
|
+
if (categories.length === 0) {
|
|
18
|
+
return {
|
|
19
|
+
content: [{ type: "text", text: "No meal categories found." }],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const list = categories
|
|
23
|
+
.map((cat) => `- ${cat.attributes.name ?? "Unknown"} (ID: ${cat.id})`)
|
|
24
|
+
.join("\n");
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: "text", text: `Meal categories:\n\n${list}` }],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
return {
|
|
31
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
32
|
+
isError: true,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
// get_recipes tool
|
|
37
|
+
server.tool("get_recipes", `Get all saved recipes - Plus subscription required.
|
|
38
|
+
|
|
39
|
+
Use this when:
|
|
40
|
+
- Browsing available recipes
|
|
41
|
+
- Finding a recipe ID for meal planning
|
|
42
|
+
|
|
43
|
+
Returns: List of recipes with their details.`, {}, async () => {
|
|
44
|
+
try {
|
|
45
|
+
const recipes = await getRecipes();
|
|
46
|
+
if (recipes.length === 0) {
|
|
47
|
+
return {
|
|
48
|
+
content: [{ type: "text", text: "No recipes found." }],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const list = recipes
|
|
52
|
+
.map((recipe) => {
|
|
53
|
+
const parts = [`- ${recipe.attributes.summary ?? "Untitled"} (ID: ${recipe.id})`];
|
|
54
|
+
if (recipe.attributes.description) {
|
|
55
|
+
parts.push(` Description: ${recipe.attributes.description}`);
|
|
56
|
+
}
|
|
57
|
+
return parts.join("\n");
|
|
58
|
+
})
|
|
59
|
+
.join("\n\n");
|
|
60
|
+
return {
|
|
61
|
+
content: [{ type: "text", text: `Recipes:\n\n${list}` }],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
return {
|
|
66
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
67
|
+
isError: true,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
// get_recipe tool
|
|
72
|
+
server.tool("get_recipe", `Get details for a specific recipe - Plus subscription required.
|
|
73
|
+
|
|
74
|
+
Parameters:
|
|
75
|
+
- recipeId (required): ID of the recipe
|
|
76
|
+
|
|
77
|
+
Returns: Recipe details including description.`, {
|
|
78
|
+
recipeId: z.string().describe("ID of the recipe"),
|
|
79
|
+
}, async ({ recipeId }) => {
|
|
80
|
+
try {
|
|
81
|
+
const recipe = await getRecipe(recipeId);
|
|
82
|
+
const parts = [`Recipe: ${recipe.attributes.summary ?? "Untitled"}`];
|
|
83
|
+
for (const [key, value] of Object.entries(recipe.attributes)) {
|
|
84
|
+
if (value !== null && value !== undefined && key !== "summary") {
|
|
85
|
+
parts.push(`${key}: ${value}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
content: [{ type: "text", text: parts.join("\n") }],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return {
|
|
94
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
95
|
+
isError: true,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
// create_recipe tool
|
|
100
|
+
server.tool("create_recipe", `Create a new recipe - Plus subscription required.
|
|
101
|
+
|
|
102
|
+
Use this when:
|
|
103
|
+
- Adding a new family recipe
|
|
104
|
+
- Saving a meal for meal planning
|
|
105
|
+
|
|
106
|
+
Parameters:
|
|
107
|
+
- summary (required): Recipe name
|
|
108
|
+
- description: Recipe details or instructions
|
|
109
|
+
- mealCategoryId: Category ID (use get_meal_categories)
|
|
110
|
+
|
|
111
|
+
Returns: The created recipe.`, {
|
|
112
|
+
summary: z.string().describe("Recipe name (e.g., 'Spaghetti Bolognese')"),
|
|
113
|
+
description: z.string().optional().describe("Recipe details or instructions"),
|
|
114
|
+
mealCategoryId: z.string().optional().describe("Meal category ID"),
|
|
115
|
+
}, async ({ summary, description, mealCategoryId }) => {
|
|
116
|
+
try {
|
|
117
|
+
const recipe = await createRecipe({ summary, description, mealCategoryId });
|
|
118
|
+
return {
|
|
119
|
+
content: [
|
|
120
|
+
{
|
|
121
|
+
type: "text",
|
|
122
|
+
text: `Created recipe "${summary}" (ID: ${recipe.id})`,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
return {
|
|
129
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
130
|
+
isError: true,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
// update_recipe tool
|
|
135
|
+
server.tool("update_recipe", `Update an existing recipe - Plus subscription required.
|
|
136
|
+
|
|
137
|
+
Parameters:
|
|
138
|
+
- recipeId (required): ID of the recipe
|
|
139
|
+
- summary: New name
|
|
140
|
+
- description: New description
|
|
141
|
+
|
|
142
|
+
Returns: The updated recipe.`, {
|
|
143
|
+
recipeId: z.string().describe("ID of the recipe to update"),
|
|
144
|
+
summary: z.string().optional().describe("New recipe name"),
|
|
145
|
+
description: z.string().nullable().optional().describe("New description"),
|
|
146
|
+
}, async ({ recipeId, summary, description }) => {
|
|
147
|
+
try {
|
|
148
|
+
const updates = {};
|
|
149
|
+
if (summary !== undefined)
|
|
150
|
+
updates.summary = summary;
|
|
151
|
+
if (description !== undefined)
|
|
152
|
+
updates.description = description;
|
|
153
|
+
const recipe = await updateRecipe(recipeId, updates);
|
|
154
|
+
return {
|
|
155
|
+
content: [
|
|
156
|
+
{
|
|
157
|
+
type: "text",
|
|
158
|
+
text: `Updated recipe (ID: ${recipe.id})`,
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
return {
|
|
165
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
166
|
+
isError: true,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
// delete_recipe tool
|
|
171
|
+
server.tool("delete_recipe", `Delete a recipe - Plus subscription required.
|
|
172
|
+
|
|
173
|
+
Parameters:
|
|
174
|
+
- recipeId (required): ID of the recipe to delete
|
|
175
|
+
|
|
176
|
+
Note: This permanently removes the recipe.`, {
|
|
177
|
+
recipeId: z.string().describe("ID of the recipe to delete"),
|
|
178
|
+
}, async ({ recipeId }) => {
|
|
179
|
+
try {
|
|
180
|
+
await deleteRecipe(recipeId);
|
|
181
|
+
return {
|
|
182
|
+
content: [{ type: "text", text: `Deleted recipe (ID: ${recipeId})` }],
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
return {
|
|
187
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
188
|
+
isError: true,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
// add_recipe_to_grocery_list tool
|
|
193
|
+
server.tool("add_recipe_to_grocery_list", `Add a recipe's ingredients to the grocery list - Plus subscription required.
|
|
194
|
+
|
|
195
|
+
Use this when:
|
|
196
|
+
- Planning to make a recipe and need to buy ingredients
|
|
197
|
+
- Adding meal ingredients to shopping list
|
|
198
|
+
|
|
199
|
+
Parameters:
|
|
200
|
+
- recipeId (required): ID of the recipe
|
|
201
|
+
|
|
202
|
+
Returns: Confirmation that ingredients were added.`, {
|
|
203
|
+
recipeId: z.string().describe("ID of the recipe"),
|
|
204
|
+
}, async ({ recipeId }) => {
|
|
205
|
+
try {
|
|
206
|
+
await addRecipeToGroceryList(recipeId);
|
|
207
|
+
return {
|
|
208
|
+
content: [
|
|
209
|
+
{
|
|
210
|
+
type: "text",
|
|
211
|
+
text: `Added recipe ingredients to grocery list`,
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
return {
|
|
218
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
219
|
+
isError: true,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
// get_meal_sittings tool
|
|
224
|
+
server.tool("get_meal_sittings", `Get scheduled meals for a date range - Plus subscription required.
|
|
225
|
+
|
|
226
|
+
Use this when:
|
|
227
|
+
- Viewing the meal plan for the week
|
|
228
|
+
- Checking what's scheduled for dinner
|
|
229
|
+
|
|
230
|
+
Parameters:
|
|
231
|
+
- date: Start date (defaults to today)
|
|
232
|
+
- dateEnd: End date (defaults to 7 days from start)
|
|
233
|
+
|
|
234
|
+
Returns: List of scheduled meals.`, {
|
|
235
|
+
date: z.string().optional().describe("Start date (YYYY-MM-DD or 'today')"),
|
|
236
|
+
dateEnd: z.string().optional().describe("End date (YYYY-MM-DD)"),
|
|
237
|
+
}, async ({ date, dateEnd }) => {
|
|
238
|
+
try {
|
|
239
|
+
const config = getConfig();
|
|
240
|
+
const startDate = date ? parseDate(date, config.timezone) : getTodayDate(config.timezone);
|
|
241
|
+
const endDate = dateEnd ? parseDate(dateEnd, config.timezone) : getDateOffset(7, config.timezone);
|
|
242
|
+
const sittings = await getMealSittings({
|
|
243
|
+
dateMin: startDate,
|
|
244
|
+
dateMax: endDate,
|
|
245
|
+
});
|
|
246
|
+
if (sittings.length === 0) {
|
|
247
|
+
return {
|
|
248
|
+
content: [
|
|
249
|
+
{
|
|
250
|
+
type: "text",
|
|
251
|
+
text: `No meals scheduled for ${formatDateForDisplay(startDate)} to ${formatDateForDisplay(endDate)}.`,
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
const list = sittings
|
|
257
|
+
.map((sitting) => {
|
|
258
|
+
const parts = [`- ${sitting.attributes.date ?? "Unknown date"}`];
|
|
259
|
+
if (sitting.attributes.meal_time) {
|
|
260
|
+
parts[0] += ` (${sitting.attributes.meal_time})`;
|
|
261
|
+
}
|
|
262
|
+
parts.push(` ID: ${sitting.id}`);
|
|
263
|
+
return parts.join("\n");
|
|
264
|
+
})
|
|
265
|
+
.join("\n\n");
|
|
266
|
+
return {
|
|
267
|
+
content: [{ type: "text", text: `Scheduled meals:\n\n${list}` }],
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
return {
|
|
272
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
273
|
+
isError: true,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
// create_meal_sitting tool
|
|
278
|
+
server.tool("create_meal_sitting", `Schedule a meal for a specific date - Plus subscription required.
|
|
279
|
+
|
|
280
|
+
Use this when:
|
|
281
|
+
- Planning meals for the week
|
|
282
|
+
- Scheduling a recipe for dinner
|
|
283
|
+
|
|
284
|
+
Parameters:
|
|
285
|
+
- date (required): Date for the meal (YYYY-MM-DD)
|
|
286
|
+
- mealCategoryId (required): Meal category ID (use get_meal_categories)
|
|
287
|
+
- recipeId: Recipe ID to schedule (optional)
|
|
288
|
+
|
|
289
|
+
Returns: The created meal sitting.`, {
|
|
290
|
+
date: z.string().describe("Date for the meal (YYYY-MM-DD or 'today', 'tomorrow')"),
|
|
291
|
+
mealCategoryId: z.string().describe("Meal category ID (e.g., ID for 'Dinner')"),
|
|
292
|
+
recipeId: z.string().optional().describe("Recipe ID to schedule"),
|
|
293
|
+
}, async ({ date, mealCategoryId, recipeId }) => {
|
|
294
|
+
try {
|
|
295
|
+
const config = getConfig();
|
|
296
|
+
const mealDate = parseDate(date, config.timezone);
|
|
297
|
+
const sitting = await createMealSitting({
|
|
298
|
+
date: mealDate,
|
|
299
|
+
mealCategoryId,
|
|
300
|
+
recipeId,
|
|
301
|
+
});
|
|
302
|
+
return {
|
|
303
|
+
content: [
|
|
304
|
+
{
|
|
305
|
+
type: "text",
|
|
306
|
+
text: `Scheduled meal for ${formatDateForDisplay(mealDate)} (ID: ${sitting.id})`,
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
return {
|
|
313
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
314
|
+
isError: true,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
//# 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,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjG,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;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,GAAG,MAAM,iBAAiB,CAAC;gBACtC,IAAI,EAAE,QAAQ;gBACd,cAAc;gBACd,QAAQ;aACT,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,sBAAsB,oBAAoB,CAAC,QAAQ,CAAC,SAAS,OAAO,CAAC,EAAE,GAAG;qBACjF;iBACF;aACF,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 @@
|
|
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/tools/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgHzD"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { getAvatars, getColors } from "../api/endpoints/misc.js";
|
|
2
|
+
import { formatErrorForMcp } from "../utils/errors.js";
|
|
3
|
+
export function registerMiscTools(server) {
|
|
4
|
+
// get_avatars tool
|
|
5
|
+
server.tool("get_avatars", `Get available avatar options for Skylight profiles.
|
|
6
|
+
|
|
7
|
+
Use this when:
|
|
8
|
+
- Setting up a new family member profile
|
|
9
|
+
- Changing someone's profile picture
|
|
10
|
+
- Exploring available avatar options
|
|
11
|
+
|
|
12
|
+
Returns: List of available avatars with their IDs and details.`, {}, async () => {
|
|
13
|
+
try {
|
|
14
|
+
const avatars = await getAvatars();
|
|
15
|
+
if (avatars.length === 0) {
|
|
16
|
+
return {
|
|
17
|
+
content: [
|
|
18
|
+
{
|
|
19
|
+
type: "text",
|
|
20
|
+
text: "No avatars found.",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const avatarList = avatars
|
|
26
|
+
.map((avatar) => {
|
|
27
|
+
const parts = [`- Avatar (ID: ${avatar.id})`];
|
|
28
|
+
for (const [key, value] of Object.entries(avatar.attributes)) {
|
|
29
|
+
if (value !== null && value !== undefined) {
|
|
30
|
+
parts.push(` ${key}: ${value}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return parts.join("\n");
|
|
34
|
+
})
|
|
35
|
+
.join("\n\n");
|
|
36
|
+
return {
|
|
37
|
+
content: [
|
|
38
|
+
{
|
|
39
|
+
type: "text",
|
|
40
|
+
text: `Available avatars:\n\n${avatarList}`,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
return {
|
|
47
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
48
|
+
isError: true,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
// get_colors tool
|
|
53
|
+
server.tool("get_colors", `Get available color options for Skylight profiles and lists.
|
|
54
|
+
|
|
55
|
+
Use this when:
|
|
56
|
+
- Choosing a color for a family member profile
|
|
57
|
+
- Setting a list color
|
|
58
|
+
- Exploring available color options
|
|
59
|
+
|
|
60
|
+
Returns: List of available colors with their IDs and hex values.`, {}, async () => {
|
|
61
|
+
try {
|
|
62
|
+
const colors = await getColors();
|
|
63
|
+
if (colors.length === 0) {
|
|
64
|
+
return {
|
|
65
|
+
content: [
|
|
66
|
+
{
|
|
67
|
+
type: "text",
|
|
68
|
+
text: "No colors found.",
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const colorList = colors
|
|
74
|
+
.map((color) => {
|
|
75
|
+
const parts = [`- Color (ID: ${color.id})`];
|
|
76
|
+
for (const [key, value] of Object.entries(color.attributes)) {
|
|
77
|
+
if (value !== null && value !== undefined) {
|
|
78
|
+
parts.push(` ${key}: ${value}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return parts.join("\n");
|
|
82
|
+
})
|
|
83
|
+
.join("\n\n");
|
|
84
|
+
return {
|
|
85
|
+
content: [
|
|
86
|
+
{
|
|
87
|
+
type: "text",
|
|
88
|
+
text: `Available colors:\n\n${colorList}`,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
return {
|
|
95
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
96
|
+
isError: true,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=misc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/tools/misc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,mBAAmB;IACnB,MAAM,CAAC,IAAI,CACT,aAAa,EACb;;;;;;;+DAO2D,EAC3D,EAAE,EACF,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,UAAU,EAAE,CAAC;YAEnC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,mBAAmB;yBAC1B;qBACF;iBACF,CAAC;YACJ,CAAC;YAED,MAAM,UAAU,GAAG,OAAO;iBACvB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;gBACd,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AE,EAAE;gBACb,MAAM,KAAK,GAAG,CAAC,gBAAgB,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;gBAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC5D,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;wBAC1C,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC;oBACnC,CAAC;gBACH,CAAC;gBACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC,CAAC;iBACD,IAAI,CAAC,MAAM,CAAC,CAAC;YAEhB,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,wBAAwB,SAAS,EAAE;qBAC1C;iBACF;aACF,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 @@
|
|
|
1
|
+
{"version":3,"file":"photos.d.ts","sourceRoot":"","sources":["../../src/tools/photos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6C1D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getAlbums } from "../api/endpoints/photos.js";
|
|
2
|
+
import { formatErrorForMcp } from "../utils/errors.js";
|
|
3
|
+
export function registerPhotoTools(server) {
|
|
4
|
+
// get_albums tool
|
|
5
|
+
server.tool("get_albums", `Get photo albums from Skylight - Plus subscription required.
|
|
6
|
+
|
|
7
|
+
Use this when:
|
|
8
|
+
- Viewing available photo albums
|
|
9
|
+
- Getting album IDs for photo management
|
|
10
|
+
|
|
11
|
+
Returns: List of photo albums with their IDs.`, {}, async () => {
|
|
12
|
+
try {
|
|
13
|
+
const albums = await getAlbums();
|
|
14
|
+
if (albums.length === 0) {
|
|
15
|
+
return {
|
|
16
|
+
content: [{ type: "text", text: "No photo albums found." }],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const list = albums
|
|
20
|
+
.map((album) => {
|
|
21
|
+
const parts = [`- ${album.attributes.name ?? "Untitled Album"} (ID: ${album.id})`];
|
|
22
|
+
for (const [key, value] of Object.entries(album.attributes)) {
|
|
23
|
+
if (value !== null && value !== undefined && key !== "name") {
|
|
24
|
+
parts.push(` ${key}: ${value}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return parts.join("\n");
|
|
28
|
+
})
|
|
29
|
+
.join("\n\n");
|
|
30
|
+
return {
|
|
31
|
+
content: [{ type: "text", text: `Photo albums:\n\n${list}` }],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: "text", text: formatErrorForMcp(error) }],
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=photos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photos.js","sourceRoot":"","sources":["../../src/tools/photos.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,kBAAkB;IAClB,MAAM,CAAC,IAAI,CACT,YAAY,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