yazio-mcp 0.0.16 → 0.0.17-beta.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.
- package/README.md +10 -2
- package/dist/api/schemas.d.ts +61 -5
- package/dist/api/types.d.ts +42 -0
- package/dist/api/yazio.d.ts +39 -7
- package/dist/index.js +3871 -3304
- package/dist/schemas.d.ts +91 -6
- package/package.json +7 -10
package/README.md
CHANGED
|
@@ -16,8 +16,8 @@ An MCP (Model Context Protocol) server that connects Claude/Cursor to your Yazio
|
|
|
16
16
|
- 🍎 **Food Tracking** - Search, add, and manage food entries
|
|
17
17
|
- 🏃♂️ **Fitness Data** - Track exercises and water intake
|
|
18
18
|
- 📓 **Diary Notes** - Read and write daily notes and feeling tags
|
|
19
|
-
- 🥣 **Recipes** - Create, log, and delete your own recipes
|
|
20
|
-
- ⚖️ **Weight Monitoring** -
|
|
19
|
+
- 🥣 **Recipes and Meals** - Create, log, and delete your own recipes and saved meals
|
|
20
|
+
- ⚖️ **Weight Monitoring** - Log weight and view its history and trends
|
|
21
21
|
- 🎯 **Goal Management** - Access and manage nutrition goals
|
|
22
22
|
- 🔍 **Product Search** - Search Yazio's extensive [food database](https://www.yazio.com/en/foods)
|
|
23
23
|
|
|
@@ -115,6 +115,14 @@ Easily log meals you forgot to track in the Yazio app directly from Claude or Cu
|
|
|
115
115
|
| `create_user_recipe` | Create a recipe from products; nutrients per portion are calculated | `name`, `portion_count`, `ingredients` |
|
|
116
116
|
| `get_user_note` | Get the diary note and feeling tags for a date | `date` |
|
|
117
117
|
| `set_user_note` | Set the diary note and/or feeling tags for a date | `date`, `note`, `tags` |
|
|
118
|
+
| `get_user_meals` | Get your saved meals | - |
|
|
119
|
+
| `create_user_meal` | Save a set of products as a meal | `name`, `products` |
|
|
120
|
+
| `delete_user_meal` | Delete a saved meal | `id` |
|
|
121
|
+
| `add_user_consumed_meal` | Log all items of a saved meal | `meal_id`, `date`, `daytime` |
|
|
122
|
+
| `add_user_weight` | Log a weight measurement in kg | `date`, `weight` |
|
|
123
|
+
| `delete_user_weight` | Delete a weight entry | `id` |
|
|
124
|
+
| `add_user_exercise` | Log a Yazio training or a custom exercise | `date`, `name`, `duration`, `energy` |
|
|
125
|
+
| `delete_user_exercise` | Delete an exercise entry | `id` |
|
|
118
126
|
|
|
119
127
|
## Test Connection
|
|
120
128
|
|
package/dist/api/schemas.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import * as z from 'zod';
|
|
|
2
2
|
export declare const DateTimeStringSchema: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}-${string}-${string} ${string}:${string}:${string}`, string>>;
|
|
3
3
|
export declare const DaytimeSchema: z.ZodEnum<{
|
|
4
4
|
breakfast: "breakfast";
|
|
5
|
-
lunch: "lunch";
|
|
6
5
|
dinner: "dinner";
|
|
6
|
+
lunch: "lunch";
|
|
7
7
|
snack: "snack";
|
|
8
8
|
}>;
|
|
9
9
|
export declare const ProductCategorySchema: z.ZodEnum<{
|
|
@@ -54,6 +54,44 @@ export declare const ServingNameSchema: z.ZodEnum<{
|
|
|
54
54
|
tablet: "tablet";
|
|
55
55
|
teaspoon: "teaspoon";
|
|
56
56
|
}>;
|
|
57
|
+
export declare const TrainingNameSchema: z.ZodEnum<{
|
|
58
|
+
badminton: "badminton";
|
|
59
|
+
baseball: "baseball";
|
|
60
|
+
basketball: "basketball";
|
|
61
|
+
bowling: "bowling";
|
|
62
|
+
canoeing: "canoeing";
|
|
63
|
+
climbing: "climbing";
|
|
64
|
+
cycling: "cycling";
|
|
65
|
+
darts: "darts";
|
|
66
|
+
football: "football";
|
|
67
|
+
frisbee: "frisbee";
|
|
68
|
+
golf: "golf";
|
|
69
|
+
gymnastics: "gymnastics";
|
|
70
|
+
handball: "handball";
|
|
71
|
+
hiit: "hiit";
|
|
72
|
+
hiking: "hiking";
|
|
73
|
+
hockey: "hockey";
|
|
74
|
+
hunting: "hunting";
|
|
75
|
+
kayaking: "kayaking";
|
|
76
|
+
pilates: "pilates";
|
|
77
|
+
rowing: "rowing";
|
|
78
|
+
rugby: "rugby";
|
|
79
|
+
running: "running";
|
|
80
|
+
skiing: "skiing";
|
|
81
|
+
snowboarding: "snowboarding";
|
|
82
|
+
soccer: "soccer";
|
|
83
|
+
squash: "squash";
|
|
84
|
+
stretching: "stretching";
|
|
85
|
+
surfing: "surfing";
|
|
86
|
+
swimming: "swimming";
|
|
87
|
+
tennis: "tennis";
|
|
88
|
+
trampoline: "trampoline";
|
|
89
|
+
treadmill: "treadmill";
|
|
90
|
+
volleyball: "volleyball";
|
|
91
|
+
walking: "walking";
|
|
92
|
+
yoga: "yoga";
|
|
93
|
+
zumba: "zumba";
|
|
94
|
+
}>;
|
|
57
95
|
export declare const NutrientsSchema: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
58
96
|
export declare const BasicNutrientsSchema: z.ZodObject<{
|
|
59
97
|
'energy.energy': z.ZodNumber;
|
|
@@ -103,8 +141,8 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
103
141
|
email: z.ZodString;
|
|
104
142
|
premium_type: z.ZodNullable<z.ZodString>;
|
|
105
143
|
sex: z.ZodEnum<{
|
|
106
|
-
male: "male";
|
|
107
144
|
female: "female";
|
|
145
|
+
male: "male";
|
|
108
146
|
other: "other";
|
|
109
147
|
}>;
|
|
110
148
|
first_name: z.ZodString;
|
|
@@ -282,8 +320,8 @@ export declare const ConsumedItemsSchema: z.ZodObject<{
|
|
|
282
320
|
date: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}-${string}-${string} ${string}:${string}:${string}`, string>>;
|
|
283
321
|
daytime: z.ZodEnum<{
|
|
284
322
|
breakfast: "breakfast";
|
|
285
|
-
lunch: "lunch";
|
|
286
323
|
dinner: "dinner";
|
|
324
|
+
lunch: "lunch";
|
|
287
325
|
snack: "snack";
|
|
288
326
|
}>;
|
|
289
327
|
type: z.ZodString;
|
|
@@ -297,8 +335,8 @@ export declare const ConsumedItemsSchema: z.ZodObject<{
|
|
|
297
335
|
date: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}-${string}-${string} ${string}:${string}:${string}`, string>>;
|
|
298
336
|
daytime: z.ZodEnum<{
|
|
299
337
|
breakfast: "breakfast";
|
|
300
|
-
lunch: "lunch";
|
|
301
338
|
dinner: "dinner";
|
|
339
|
+
lunch: "lunch";
|
|
302
340
|
snack: "snack";
|
|
303
341
|
}>;
|
|
304
342
|
type: z.ZodOptional<z.ZodString>;
|
|
@@ -310,8 +348,8 @@ export declare const ConsumedItemsSchema: z.ZodObject<{
|
|
|
310
348
|
date: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}-${string}-${string} ${string}:${string}:${string}`, string>>;
|
|
311
349
|
daytime: z.ZodEnum<{
|
|
312
350
|
breakfast: "breakfast";
|
|
313
|
-
lunch: "lunch";
|
|
314
351
|
dinner: "dinner";
|
|
352
|
+
lunch: "lunch";
|
|
315
353
|
snack: "snack";
|
|
316
354
|
}>;
|
|
317
355
|
type: z.ZodOptional<z.ZodString>;
|
|
@@ -411,3 +449,21 @@ export declare const FeelingSchema: z.ZodObject<{
|
|
|
411
449
|
note: z.ZodNullable<z.ZodString>;
|
|
412
450
|
tags: z.ZodArray<z.ZodString>;
|
|
413
451
|
}, z.core.$loose>;
|
|
452
|
+
export declare const MealsSchema: z.ZodArray<z.ZodObject<{
|
|
453
|
+
id: z.ZodString;
|
|
454
|
+
name: z.ZodString;
|
|
455
|
+
products: z.ZodArray<z.ZodObject<{
|
|
456
|
+
product_id: z.ZodString;
|
|
457
|
+
amount: z.ZodNumber;
|
|
458
|
+
serving: z.ZodNullable<z.ZodString>;
|
|
459
|
+
serving_quantity: z.ZodNullable<z.ZodNumber>;
|
|
460
|
+
}, z.core.$loose>>;
|
|
461
|
+
simple_products: z.ZodArray<z.ZodObject<{
|
|
462
|
+
name: z.ZodString;
|
|
463
|
+
nutrients: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
464
|
+
}, z.core.$loose>>;
|
|
465
|
+
recipe_portions: z.ZodArray<z.ZodObject<{
|
|
466
|
+
recipe_id: z.ZodString;
|
|
467
|
+
portion_count: z.ZodNumber;
|
|
468
|
+
}, z.core.$loose>>;
|
|
469
|
+
}, z.core.$loose>>;
|
package/dist/api/types.d.ts
CHANGED
|
@@ -15,7 +15,9 @@ export type YazioProductSearchResult = z.infer<typeof S.ProductSearchResultsSche
|
|
|
15
15
|
export type YazioProduct = z.infer<typeof S.ProductSchema>;
|
|
16
16
|
export type YazioRecipe = z.infer<typeof S.RecipeSchema>;
|
|
17
17
|
export type YazioFeeling = z.infer<typeof S.FeelingSchema>;
|
|
18
|
+
export type YazioMeal = z.infer<typeof S.MealsSchema>[number];
|
|
18
19
|
export type Daytime = z.infer<typeof S.DaytimeSchema>;
|
|
20
|
+
export type TrainingName = z.infer<typeof S.TrainingNameSchema>;
|
|
19
21
|
/** "YYYY-MM-DD" or "YYYY-MM-DD HH:mm:ss" (local time, sent as is) */
|
|
20
22
|
export type YazioDateTime = string;
|
|
21
23
|
/** "YYYY-MM-DD HH:mm:ss" */
|
|
@@ -85,6 +87,46 @@ export interface CreateUserRecipeDto {
|
|
|
85
87
|
}[];
|
|
86
88
|
instructions: string[];
|
|
87
89
|
}
|
|
90
|
+
export interface CreateMealDto {
|
|
91
|
+
id: string;
|
|
92
|
+
name: string;
|
|
93
|
+
products: {
|
|
94
|
+
product_id: string;
|
|
95
|
+
amount: number;
|
|
96
|
+
serving: string | null;
|
|
97
|
+
serving_quantity: number | null;
|
|
98
|
+
}[];
|
|
99
|
+
simple_products: {
|
|
100
|
+
name: string;
|
|
101
|
+
nutrients: Record<string, number>;
|
|
102
|
+
}[];
|
|
103
|
+
recipe_portions: {
|
|
104
|
+
recipe_id: string;
|
|
105
|
+
portion_count: number;
|
|
106
|
+
}[];
|
|
107
|
+
}
|
|
108
|
+
/** Weight in kg */
|
|
109
|
+
export interface WeightDto {
|
|
110
|
+
id: string;
|
|
111
|
+
date: YazioDateTime;
|
|
112
|
+
value: number;
|
|
113
|
+
}
|
|
114
|
+
/** The API stores 0 kcal when `energy` is missing */
|
|
115
|
+
export interface ExerciseDto<Name extends string = string> {
|
|
116
|
+
id: string;
|
|
117
|
+
date: DateTimeString;
|
|
118
|
+
name: Name;
|
|
119
|
+
/** Minutes */
|
|
120
|
+
duration: number;
|
|
121
|
+
/** kcal */
|
|
122
|
+
energy: number;
|
|
123
|
+
note?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface AddExercisesDto {
|
|
126
|
+
/** The API rejects a name outside its own list, which is longer than TrainingName */
|
|
127
|
+
training?: ExerciseDto<TrainingName | (string & {})>[];
|
|
128
|
+
custom_training?: ExerciseDto[];
|
|
129
|
+
}
|
|
88
130
|
/**
|
|
89
131
|
* POST /user/water-intake, found in https://github.com/juriadams/yazio/issues/3:
|
|
90
132
|
* - the body is a bare array of entries, not wrapped in an object;
|
package/dist/api/yazio.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { YazioHttp, type Credentials, type YazioHttpOptions } from './http.js';
|
|
2
|
-
import type { AddConsumedItemsDto, CreateProductDto, CreateUserRecipeDto, Daytime, ProductSearchOptions, WaterIntakeEntry, YazioFeeling } from './types.js';
|
|
2
|
+
import type { AddConsumedItemsDto, AddExercisesDto, CreateMealDto, CreateProductDto, CreateUserRecipeDto, Daytime, ProductSearchOptions, WaterIntakeEntry, WeightDto, YazioFeeling } from './types.js';
|
|
3
3
|
export declare const today: () => string;
|
|
4
4
|
export declare class YazioApi {
|
|
5
5
|
readonly http: YazioHttp;
|
|
@@ -15,7 +15,7 @@ export declare class YazioApi {
|
|
|
15
15
|
} | null;
|
|
16
16
|
email: string;
|
|
17
17
|
premium_type: string | null;
|
|
18
|
-
sex: "
|
|
18
|
+
sex: "female" | "male" | "other";
|
|
19
19
|
first_name: string;
|
|
20
20
|
last_name: string | null;
|
|
21
21
|
city: string;
|
|
@@ -165,6 +165,10 @@ export declare class YazioApi {
|
|
|
165
165
|
date: `${string}-${string}-${string} ${string}:${string}:${string}`;
|
|
166
166
|
value: number;
|
|
167
167
|
}[]>;
|
|
168
|
+
/** The body is keyed by value type; v15 accepts only weight */
|
|
169
|
+
addWeights: (entries: WeightDto[]) => Promise<void>;
|
|
170
|
+
/** Any body value IDs */
|
|
171
|
+
deleteBodyValues: (ids: string[]) => Promise<void>;
|
|
168
172
|
getExercises: (date?: string) => Promise<{
|
|
169
173
|
[x: string]: unknown;
|
|
170
174
|
training: {
|
|
@@ -196,6 +200,9 @@ export declare class YazioApi {
|
|
|
196
200
|
steps: number;
|
|
197
201
|
}[];
|
|
198
202
|
}>;
|
|
203
|
+
addExercises: (exercises: AddExercisesDto) => Promise<void>;
|
|
204
|
+
/** Trainings and custom trainings alike */
|
|
205
|
+
deleteExercises: (ids: string[]) => Promise<void>;
|
|
199
206
|
getSuggestedProducts: (daytime: Daytime, date?: string) => Promise<{
|
|
200
207
|
[x: string]: unknown;
|
|
201
208
|
product_id: string;
|
|
@@ -209,7 +216,7 @@ export declare class YazioApi {
|
|
|
209
216
|
[x: string]: unknown;
|
|
210
217
|
id: string;
|
|
211
218
|
date: `${string}-${string}-${string} ${string}:${string}:${string}`;
|
|
212
|
-
daytime: "breakfast" | "
|
|
219
|
+
daytime: "breakfast" | "dinner" | "lunch" | "snack";
|
|
213
220
|
type: string;
|
|
214
221
|
product_id: string;
|
|
215
222
|
amount: number;
|
|
@@ -220,19 +227,19 @@ export declare class YazioApi {
|
|
|
220
227
|
[x: string]: unknown;
|
|
221
228
|
id: string;
|
|
222
229
|
date: `${string}-${string}-${string} ${string}:${string}:${string}`;
|
|
223
|
-
daytime: "breakfast" | "
|
|
230
|
+
daytime: "breakfast" | "dinner" | "lunch" | "snack";
|
|
231
|
+
type?: string | undefined;
|
|
224
232
|
recipe_id: string;
|
|
225
233
|
portion_count: number;
|
|
226
|
-
type?: string | undefined;
|
|
227
234
|
}[];
|
|
228
235
|
simple_products: {
|
|
229
236
|
[x: string]: unknown;
|
|
230
237
|
id: string;
|
|
231
238
|
date: `${string}-${string}-${string} ${string}:${string}:${string}`;
|
|
232
|
-
daytime: "breakfast" | "
|
|
239
|
+
daytime: "breakfast" | "dinner" | "lunch" | "snack";
|
|
240
|
+
type?: string | undefined;
|
|
233
241
|
name: string;
|
|
234
242
|
nutrients: Record<string, number>;
|
|
235
|
-
type?: string | undefined;
|
|
236
243
|
is_ai_generated?: boolean | undefined;
|
|
237
244
|
}[];
|
|
238
245
|
}>;
|
|
@@ -352,4 +359,29 @@ export declare class YazioApi {
|
|
|
352
359
|
}>;
|
|
353
360
|
/** Replaces the day's note and tags; the API ignores a date in the body */
|
|
354
361
|
setFeeling: (date: string, feeling: YazioFeeling) => Promise<void>;
|
|
362
|
+
/** Saved meals: named sets of foods that are logged together */
|
|
363
|
+
getMeals: () => Promise<{
|
|
364
|
+
[x: string]: unknown;
|
|
365
|
+
id: string;
|
|
366
|
+
name: string;
|
|
367
|
+
products: {
|
|
368
|
+
[x: string]: unknown;
|
|
369
|
+
product_id: string;
|
|
370
|
+
amount: number;
|
|
371
|
+
serving: string | null;
|
|
372
|
+
serving_quantity: number | null;
|
|
373
|
+
}[];
|
|
374
|
+
simple_products: {
|
|
375
|
+
[x: string]: unknown;
|
|
376
|
+
name: string;
|
|
377
|
+
nutrients: Record<string, number>;
|
|
378
|
+
}[];
|
|
379
|
+
recipe_portions: {
|
|
380
|
+
[x: string]: unknown;
|
|
381
|
+
recipe_id: string;
|
|
382
|
+
portion_count: number;
|
|
383
|
+
}[];
|
|
384
|
+
}[]>;
|
|
385
|
+
createMeal: (meal: CreateMealDto) => Promise<void>;
|
|
386
|
+
deleteMeal: (id: string) => Promise<void>;
|
|
355
387
|
}
|