get_lifestyle_logging_data
Retrieve daily lifestyle logging data for a specified date from Garmin Connect to access hydration, stress, and other lifestyle metrics.
Instructions
Get daily lifestyle logging data for a date
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date in YYYY-MM-DD format. Defaults to today if not provided |
Implementation Reference
- src/tools/wellness.tools.ts:47-59 (registration)Registration of the 'get_lifestyle_logging_data' tool via server.registerTool, with schema using dateParamSchema and handler calling client.getLifestyleLoggingData
server.registerTool( 'get_lifestyle_logging_data', { description: 'Get daily lifestyle logging data for a date', inputSchema: dateParamSchema.shape, }, async ({ date }) => { const data = await client.getLifestyleLoggingData(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/client/garmin.client.ts:569-572 (handler)Handler/client method getLifestyleLoggingData that calls the Garmin API endpoint with the resolved date
async getLifestyleLoggingData(date?: string): Promise<unknown> { const resolvedDate = date ?? todayString(); return this.request(`${LIFESTYLE_LOGGING_ENDPOINT}/${resolvedDate}`); } - src/dtos/date-params.dto.ts:8-12 (schema)Input schema (dateParamSchema) used by the tool - defines optional 'date' parameter in YYYY-MM-DD format
export const dateParamSchema = z.object({ date: dateString .optional() .describe('Date in YYYY-MM-DD format. Defaults to today if not provided'), }); - API endpoint constant used by the handler: LIFESTYLE_LOGGING_ENDPOINT = '/lifestylelogging-service/dailyLog'
export const LIFESTYLE_LOGGING_ENDPOINT = '/lifestylelogging-service/dailyLog'; - src/index.ts:49-49 (registration)Top-level registration of wellness tools (includes get_lifestyle_logging_data) via registerWellnessTools(server, client)
registerWellnessTools(server, client);