yazio-mcp 0.0.16-beta.1 → 0.0.16-beta.2

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 CHANGED
@@ -93,7 +93,8 @@ Easily log meals you forgot to track in the Yazio app directly from Claude or Cu
93
93
  | `get_user` | Get user profile | - |
94
94
  | `get_user_daily_summary` | Get daily nutrition summary | `date` |
95
95
  | `get_user_consumed_items` | Get food entries for a date | `date` |
96
- | `get_user_weight` | Get weight data | `date` (optional) |
96
+ | `get_user_weight` | Get the last weight entry up to a date | `date` (optional) |
97
+ | `get_user_weight_history` | Get all weight entries in a date range | `start`, `end` (optional) |
97
98
  | `get_user_exercises` | Get exercise data | `date` |
98
99
  | `get_user_water_intake` | Get water intake | `date` |
99
100
  | `get_user_goals` | Get nutrition goals | `date` (optional) |
@@ -1,4 +1,5 @@
1
1
  import * as z from 'zod';
2
+ export declare const DateTimeStringSchema: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}-${string}-${string} ${string}:${string}:${string}`, string>>;
2
3
  export declare const DaytimeSchema: z.ZodEnum<{
3
4
  breakfast: "breakfast";
4
5
  lunch: "lunch";
@@ -100,14 +101,14 @@ export declare const UserSchema: z.ZodObject<{
100
101
  name: z.ZodString;
101
102
  }, z.core.$loose>>;
102
103
  email: z.ZodString;
103
- premium_type: z.ZodString;
104
+ premium_type: z.ZodNullable<z.ZodString>;
104
105
  sex: z.ZodEnum<{
105
106
  male: "male";
106
107
  female: "female";
107
108
  other: "other";
108
109
  }>;
109
110
  first_name: z.ZodString;
110
- last_name: z.ZodString;
111
+ last_name: z.ZodNullable<z.ZodString>;
111
112
  city: z.ZodString;
112
113
  country: z.ZodString;
113
114
  weight_change_per_week: z.ZodNumber;
@@ -224,9 +225,13 @@ export declare const DailySummarySchema: z.ZodObject<{
224
225
  }, z.core.$loose>;
225
226
  active_fasting_countdown_template_key: z.ZodNullable<z.ZodString>;
226
227
  }, z.core.$loose>;
228
+ export declare const WeightHistorySchema: z.ZodArray<z.ZodObject<{
229
+ date: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}-${string}-${string} ${string}:${string}:${string}`, string>>;
230
+ value: z.ZodNumber;
231
+ }, z.core.$loose>>;
227
232
  export declare const WeightEntrySchema: z.ZodObject<{
228
233
  id: z.ZodString;
229
- date: z.ZodString;
234
+ date: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}-${string}-${string} ${string}:${string}:${string}`, string>>;
230
235
  value: z.ZodNullable<z.ZodNumber>;
231
236
  external_id: z.ZodNullable<z.ZodString>;
232
237
  gateway: z.ZodNullable<z.ZodString>;
@@ -274,7 +279,7 @@ export declare const WaterIntakeSchema: z.ZodObject<{
274
279
  export declare const ConsumedItemsSchema: z.ZodObject<{
275
280
  products: z.ZodArray<z.ZodObject<{
276
281
  id: z.ZodString;
277
- date: z.ZodString;
282
+ date: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}-${string}-${string} ${string}:${string}:${string}`, string>>;
278
283
  daytime: z.ZodEnum<{
279
284
  breakfast: "breakfast";
280
285
  lunch: "lunch";
@@ -289,7 +294,7 @@ export declare const ConsumedItemsSchema: z.ZodObject<{
289
294
  }, z.core.$loose>>;
290
295
  recipe_portions: z.ZodArray<z.ZodObject<{
291
296
  id: z.ZodString;
292
- date: z.ZodString;
297
+ date: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}-${string}-${string} ${string}:${string}:${string}`, string>>;
293
298
  daytime: z.ZodEnum<{
294
299
  breakfast: "breakfast";
295
300
  lunch: "lunch";
@@ -302,7 +307,7 @@ export declare const ConsumedItemsSchema: z.ZodObject<{
302
307
  }, z.core.$loose>>;
303
308
  simple_products: z.ZodArray<z.ZodObject<{
304
309
  id: z.ZodString;
305
- date: z.ZodString;
310
+ date: z.ZodPipe<z.ZodString, z.ZodTransform<`${string}-${string}-${string} ${string}:${string}:${string}`, string>>;
306
311
  daytime: z.ZodEnum<{
307
312
  breakfast: "breakfast";
308
313
  lunch: "lunch";
@@ -6,6 +6,7 @@ export type YazioDietaryPreferences = z.infer<typeof S.DietaryPreferencesSchema>
6
6
  export type YazioGoals = z.infer<typeof S.GoalsSchema>;
7
7
  export type YazioDailySummary = z.infer<typeof S.DailySummarySchema>;
8
8
  export type YazioWeightEntry = z.infer<typeof S.WeightEntrySchema>;
9
+ export type YazioWeightHistory = z.infer<typeof S.WeightHistorySchema>;
9
10
  export type YazioExercises = z.infer<typeof S.ExercisesSchema>;
10
11
  export type YazioSuggestedProduct = z.infer<typeof S.SuggestedProductsSchema>[number];
11
12
  export type YazioWaterIntake = z.infer<typeof S.WaterIntakeSchema>;
@@ -14,10 +14,10 @@ export declare class YazioApi {
14
14
  name: string;
15
15
  } | null;
16
16
  email: string;
17
- premium_type: string;
17
+ premium_type: string | null;
18
18
  sex: "male" | "female" | "other";
19
19
  first_name: string;
20
- last_name: string;
20
+ last_name: string | null;
21
21
  city: string;
22
22
  country: string;
23
23
  weight_change_per_week: number;
@@ -153,12 +153,18 @@ export declare class YazioApi {
153
153
  getLastWeight: (date?: string) => Promise<{
154
154
  [x: string]: unknown;
155
155
  id: string;
156
- date: string;
156
+ date: `${string}-${string}-${string} ${string}:${string}:${string}`;
157
157
  value: number | null;
158
158
  external_id: string | null;
159
159
  gateway: string | null;
160
160
  source: string | null;
161
161
  } | null>;
162
+ /** Every entry between the dates, both included; a day can have several */
163
+ getWeightHistory: (start: string, end?: string) => Promise<{
164
+ [x: string]: unknown;
165
+ date: `${string}-${string}-${string} ${string}:${string}:${string}`;
166
+ value: number;
167
+ }[]>;
162
168
  getExercises: (date?: string) => Promise<{
163
169
  [x: string]: unknown;
164
170
  training: {
@@ -202,7 +208,7 @@ export declare class YazioApi {
202
208
  products: {
203
209
  [x: string]: unknown;
204
210
  id: string;
205
- date: string;
211
+ date: `${string}-${string}-${string} ${string}:${string}:${string}`;
206
212
  daytime: "breakfast" | "lunch" | "dinner" | "snack";
207
213
  type: string;
208
214
  product_id: string;
@@ -213,7 +219,7 @@ export declare class YazioApi {
213
219
  recipe_portions: {
214
220
  [x: string]: unknown;
215
221
  id: string;
216
- date: string;
222
+ date: `${string}-${string}-${string} ${string}:${string}:${string}`;
217
223
  daytime: "breakfast" | "lunch" | "dinner" | "snack";
218
224
  recipe_id: string;
219
225
  portion_count: number;
@@ -222,7 +228,7 @@ export declare class YazioApi {
222
228
  simple_products: {
223
229
  [x: string]: unknown;
224
230
  id: string;
225
- date: string;
231
+ date: `${string}-${string}-${string} ${string}:${string}:${string}`;
226
232
  daytime: "breakfast" | "lunch" | "dinner" | "snack";
227
233
  name: string;
228
234
  nutrients: Record<string, number>;
package/dist/index.js CHANGED
@@ -22139,6 +22139,7 @@ function v4(options, buf, offset) {
22139
22139
  var v4_default = v4;
22140
22140
 
22141
22141
  // src/api/schemas.ts
22142
+ var DateTimeStringSchema = string2().regex(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]) ([01]\d|2[0-3]):[0-5]\d:[0-5]\d$/).transform((value) => value);
22142
22143
  var DaytimeSchema = _enum(["breakfast", "lunch", "dinner", "snack"]);
22143
22144
  var ProductCategorySchema = _enum([
22144
22145
  "babyfood",
@@ -22231,10 +22232,10 @@ var UserSchema = looseObject({
22231
22232
  name: string2()
22232
22233
  }).nullable(),
22233
22234
  email: string2(),
22234
- premium_type: string2(),
22235
+ premium_type: string2().nullable(),
22235
22236
  sex: _enum(["male", "female", "other"]),
22236
22237
  first_name: string2(),
22237
- last_name: string2(),
22238
+ last_name: string2().nullable(),
22238
22239
  city: string2(),
22239
22240
  country: string2(),
22240
22241
  weight_change_per_week: number2(),
@@ -22315,9 +22316,10 @@ var DailySummarySchema = looseObject({
22315
22316
  }),
22316
22317
  active_fasting_countdown_template_key: string2().nullable()
22317
22318
  });
22319
+ var WeightHistorySchema = array(looseObject({ date: DateTimeStringSchema, value: number2() }));
22318
22320
  var WeightEntrySchema = looseObject({
22319
22321
  id: string2(),
22320
- date: string2(),
22322
+ date: DateTimeStringSchema,
22321
22323
  value: number2().nullable(),
22322
22324
  external_id: string2().nullable(),
22323
22325
  gateway: string2().nullable(),
@@ -22355,7 +22357,7 @@ var WaterIntakeSchema = looseObject({
22355
22357
  });
22356
22358
  var ConsumedProductSchema = looseObject({
22357
22359
  id: string2(),
22358
- date: string2(),
22360
+ date: DateTimeStringSchema,
22359
22361
  daytime: DaytimeSchema,
22360
22362
  type: string2(),
22361
22363
  product_id: string2(),
@@ -22365,7 +22367,7 @@ var ConsumedProductSchema = looseObject({
22365
22367
  });
22366
22368
  var ConsumedRecipePortionSchema = looseObject({
22367
22369
  id: string2(),
22368
- date: string2(),
22370
+ date: DateTimeStringSchema,
22369
22371
  daytime: DaytimeSchema,
22370
22372
  type: string2().optional(),
22371
22373
  recipe_id: string2(),
@@ -22373,7 +22375,7 @@ var ConsumedRecipePortionSchema = looseObject({
22373
22375
  });
22374
22376
  var ConsumedSimpleProductSchema = looseObject({
22375
22377
  id: string2(),
22376
- date: string2(),
22378
+ date: DateTimeStringSchema,
22377
22379
  daytime: DaytimeSchema,
22378
22380
  type: string2().optional(),
22379
22381
  name: string2(),
@@ -22475,6 +22477,10 @@ var GetUserInfoInputSchema = EmptyInputSchema;
22475
22477
  var GetUserWeightInputSchema = object({
22476
22478
  date: DateStringSchema.optional().describe("Returns the last weight entry up to this date (defaults to today)")
22477
22479
  });
22480
+ var GetUserWeightHistoryInputSchema = object({
22481
+ start: DateStringSchema.describe("First date, included"),
22482
+ end: DateStringSchema.optional().describe("Last date, included (defaults to today)")
22483
+ });
22478
22484
  var GetWaterIntakeInputSchema = DateInputSchema;
22479
22485
  var SearchProductsInputSchema = QueryInputSchema;
22480
22486
  function lenient(schema) {
@@ -22511,7 +22517,6 @@ var GetUserSuggestedProductsInputSchema = object({
22511
22517
  daytime: DaytimeSchema.optional().describe("Meal to get suggestions for (defaults to breakfast)"),
22512
22518
  limit: LimitSchema
22513
22519
  });
22514
- var DateTimeStringSchema = string2().regex(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]) ([01]\d|2[0-3]):[0-5]\d:[0-5]\d$/).transform((value) => value);
22515
22520
  var ConsumedAtSchema = union([DateStringSchema, DateTimeStringSchema]).describe('Date and time when the food was consumed in "YYYY-MM-DD HH:mm:ss" format (e.g., "2025-12-18 12:30:00"), or date only in YYYY-MM-DD format');
22516
22521
  var AddConsumedItemInputSchema = object({
22517
22522
  // id: ProductIdSchema.describe('Random identifier for the consumed item'),
@@ -22731,6 +22736,8 @@ var YazioApi = class {
22731
22736
  getGoals = (date5 = today()) => this.http.request("GET", "/user/goals/unmodified", { query: { date: date5 }, schema: GoalsSchema });
22732
22737
  getDailySummary = (date5) => this.http.request("GET", "/user/widgets/daily-summary", { query: { date: date5 }, schema: DailySummarySchema });
22733
22738
  getLastWeight = (date5 = today()) => this.http.request("GET", "/user/bodyvalues/weight/last", { query: { date: date5 }, schema: WeightEntrySchema.nullable() });
22739
+ /** Every entry between the dates, both included; a day can have several */
22740
+ getWeightHistory = (start, end = today()) => this.http.request("GET", "/user/bodyvalues/weight", { query: { start, end }, schema: WeightHistorySchema });
22734
22741
  getExercises = (date5 = today()) => this.http.request("GET", "/user/exercises", { query: { date: date5 }, schema: ExercisesSchema });
22735
22742
  getSuggestedProducts = (daytime, date5 = today()) => this.http.request("GET", "/user/products/suggested", { query: { date: date5, daytime }, schema: SuggestedProductsSchema });
22736
22743
  getConsumedItems = (date5) => this.http.request("GET", "/user/consumed-items", { query: { date: date5 }, schema: ConsumedItemsSchema });
@@ -22955,7 +22962,7 @@ var YazioMcpServer = class {
22955
22962
  "get_user_weight",
22956
22963
  {
22957
22964
  title: "Get Weight",
22958
- description: "Get user weight data",
22965
+ description: "Get the last weight entry up to a date. Use get_user_weight_history for all entries in a date range.",
22959
22966
  inputSchema: GetUserWeightInputSchema,
22960
22967
  annotations: {
22961
22968
  readOnlyHint: true,
@@ -22966,6 +22973,21 @@ var YazioMcpServer = class {
22966
22973
  return await this.getUserWeight(args);
22967
22974
  }
22968
22975
  );
22976
+ server.registerTool(
22977
+ "get_user_weight_history",
22978
+ {
22979
+ title: "Get Weight History",
22980
+ description: "Get all weight entries between two dates in one call, e.g. for trends. A day can have several entries at different times.",
22981
+ inputSchema: GetUserWeightHistoryInputSchema,
22982
+ annotations: {
22983
+ readOnlyHint: true,
22984
+ idempotentHint: true
22985
+ }
22986
+ },
22987
+ async (args) => {
22988
+ return await this.getUserWeightHistory(args);
22989
+ }
22990
+ );
22969
22991
  server.registerTool(
22970
22992
  "get_user_daily_summary",
22971
22993
  {
@@ -23437,6 +23459,24 @@ ${JSON.stringify(weight, null, 2)}`
23437
23459
  throw new Error(`Failed to get user weight: ${error2}`);
23438
23460
  }
23439
23461
  }
23462
+ async getUserWeightHistory(args) {
23463
+ const client = await this.ensureAuthenticated();
23464
+ try {
23465
+ const entries = await client.getWeightHistory(args.start, args.end);
23466
+ return {
23467
+ content: [
23468
+ {
23469
+ type: "text",
23470
+ text: `Weight entries (${entries.length}):
23471
+
23472
+ ${JSON.stringify(entries, null, 2)}`
23473
+ }
23474
+ ]
23475
+ };
23476
+ } catch (error2) {
23477
+ throw new Error(`Failed to get weight history: ${error2}`);
23478
+ }
23479
+ }
23440
23480
  async getUserWaterIntake(args) {
23441
23481
  const client = await this.ensureAuthenticated();
23442
23482
  try {
package/dist/schemas.d.ts CHANGED
@@ -33,6 +33,10 @@ export declare const GetUserInfoInputSchema: z.ZodObject<{}, z.core.$strip>;
33
33
  export declare const GetUserWeightInputSchema: z.ZodObject<{
34
34
  date: z.ZodOptional<z.ZodISODate>;
35
35
  }, z.core.$strip>;
36
+ export declare const GetUserWeightHistoryInputSchema: z.ZodObject<{
37
+ start: z.ZodISODate;
38
+ end: z.ZodOptional<z.ZodISODate>;
39
+ }, z.core.$strip>;
36
40
  export declare const GetWaterIntakeInputSchema: z.ZodObject<{
37
41
  date: z.ZodISODate;
38
42
  }, z.core.$strip>;
@@ -215,6 +219,7 @@ export type GetFoodEntriesInput = z.infer<typeof GetFoodEntriesInputSchema>;
215
219
  export type GetDailySummaryInput = z.infer<typeof GetDailySummaryInputSchema>;
216
220
  export type GetUserInfoInput = z.infer<typeof GetUserInfoInputSchema>;
217
221
  export type GetUserWeightInput = z.infer<typeof GetUserWeightInputSchema>;
222
+ export type GetUserWeightHistoryInput = z.infer<typeof GetUserWeightHistoryInputSchema>;
218
223
  export type GetWaterIntakeInput = z.infer<typeof GetWaterIntakeInputSchema>;
219
224
  export type SearchProductsInput = z.infer<typeof SearchProductsInputSchema>;
220
225
  export type GetProductInput = z.infer<typeof GetProductInputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yazio-mcp",
3
- "version": "0.0.16-beta.1",
3
+ "version": "0.0.16-beta.2",
4
4
  "description": "MCP server for accessing Yazio user & nutrition data (unofficial)",
5
5
  "mcpName": "io.github.fliptheweb/yazio-mcp",
6
6
  "author": "fliptheweb",