get_daily_events
Retrieve daily wellness events for any specified date to track health and fitness activities.
Instructions
Get daily wellness events for a specific 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/health.tools.ts:192-204 (handler)The tool handler for 'get_daily_events'. Registers the tool on the MCP server with a description and input schema, and calls client.getDailyEvents(date) to retrieve data, returning it as JSON text.
server.registerTool( 'get_daily_events', { description: 'Get daily wellness events for a specific date', inputSchema: dateParamSchema.shape, }, async ({ date }) => { const data = await client.getDailyEvents(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/dtos/date-params.dto.ts:8-12 (schema)Input schema for the tool. Uses Zod to define an optional 'date' string parameter in YYYY-MM-DD format, defaulting to today.
export const dateParamSchema = z.object({ date: dateString .optional() .describe('Date in YYYY-MM-DD format. Defaults to today if not provided'), }); - src/client/garmin.client.ts:318-321 (helper)Client method that makes the HTTP request to the Garmin API. Falls back to today's date if none provided, then calls the DAILY_EVENTS_ENDPOINT with a calendarDate query parameter.
async getDailyEvents(date?: string): Promise<unknown> { const resolvedDate = date ?? todayString(); return this.request(`${DAILY_EVENTS_ENDPOINT}?calendarDate=${resolvedDate}`); } - The API endpoint constant for daily events, pointing to '/wellness-service/wellness/dailyEvents'.
export const DAILY_EVENTS_ENDPOINT = '/wellness-service/wellness/dailyEvents'; - src/tools/health.tools.ts:192-205 (registration)Registration of the 'get_daily_events' tool via server.registerTool() within the registerHealthTools() function.
server.registerTool( 'get_daily_events', { description: 'Get daily wellness events for a specific date', inputSchema: dateParamSchema.shape, }, async ({ date }) => { const data = await client.getDailyEvents(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); }