Google Health Daily Rollup
google_health_daily_rollupAggregate daily health data from Google Health over a civil date range. Summarize steps, distance, calories, active minutes, weight, and heart rate metrics.
Instructions
Aggregate a data type over civil days using Google Health dailyRollUp. Useful for steps, distance, calories, active minutes, weight and heart summaries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data_type | No | Google Health data type in kebab case, e.g. steps, sleep, heart-rate, daily-resting-heart-rate. | steps |
| start_date | No | today | |
| end_date | No | Exclusive end date as YYYY-MM-DD. Defaults to the next day. | today |
| window_size_days | No | ||
| page_size | No | ||
| page_token | No | ||
| data_source_family | No | ||
| privacy_mode | No | Optional per-call privacy override. Defaults to GOOGLE_HEALTH_PRIVACY_MODE or structured. raw returns upstream Google Health JSON. | |
| response_format | No | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpoint | Yes | ||
| privacy_mode | Yes | ||
| data | Yes |
Implementation Reference
- src/tools/google-health-tools.ts:228-252 (handler)The handler function for the google_health_daily_rollup tool. It registers the tool, calls the Google Health API dailyRollUp endpoint via the client, applies privacy mode, and formats the response.
server.registerTool("google_health_daily_rollup", { title: "Google Health Daily Rollup", description: "Aggregate a data type over civil days using Google Health dailyRollUp. Useful for steps, distance, calories, active minutes, weight and heart summaries.", inputSchema: DailyRollupInputSchema.shape, outputSchema: EndpointDataOutputSchema.shape, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true } }, async (params) => { try { const config = getConfig(); const mode = resolvePrivacyMode(config, params.privacy_mode); const endpoint = `/v4/users/me/dataTypes/${params.data_type}/dataPoints:dailyRollUp`; const data = applyPrivacy(endpoint, await new GoogleHealthClient(config).dailyRollup({ dataType: params.data_type, startDate: params.start_date, endDate: params.end_date, windowSizeDays: params.window_size_days, pageSize: params.page_size, pageToken: params.page_token, dataSourceFamily: params.data_source_family }), mode); return makeResponse(endpointOutput(endpoint, mode, data), params.response_format, bulletList("Google Health Daily Rollup", { endpoint, data_type: params.data_type, data: JSON.stringify(data) })); } catch (error) { return makeError((error as Error).message); } }); - src/schemas/common.ts:61-71 (schema)Input validation schema for the daily rollup tool using Zod. Defines all parameters: data_type, start_date, end_date, window_size_days, page_size, page_token, data_source_family, privacy_mode, and response_format.
export const DailyRollupInputSchema = z.object({ data_type: GoogleHealthDataTypeSchema.default("steps"), start_date: DateSchema, end_date: DateSchema.optional().describe("Exclusive end date as YYYY-MM-DD. Defaults to the next day."), window_size_days: z.number().int().min(1).max(90).default(1), page_size: z.number().int().min(1).max(MAX_GOOGLE_HEALTH_LIMIT).default(DEFAULT_LIMIT), page_token: z.string().optional(), data_source_family: DataSourceFamilySchema, privacy_mode: PrivacyModeSchema, response_format: ResponseFormatSchema }).strict(); - The GoogleHealthClient method that makes the actual POST request to the Google Health API dailyRollUp endpoint. Builds the request body with civil date range, window size, pagination, and data source family parameters.
async dailyRollup(query: DailyRollupQuery): Promise<unknown> { return this.post(`/v4/users/me/dataTypes/${encodeDataType(query.dataType)}/dataPoints:dailyRollUp`, { range: civilDateRange(query.startDate, query.endDate ?? nextDate(query.startDate)), windowSizeDays: query.windowSizeDays ?? 1, pageSize: normalizePageSize(query.pageSize), pageToken: query.pageToken, dataSourceFamily: query.dataSourceFamily }); } - TypeScript interface defining the query parameters for the dailyRollup method.
export interface DailyRollupQuery extends PageParams { dataType: string; startDate: string; endDate?: string; windowSizeDays?: number; dataSourceFamily?: string; } - src/services/agent-manifest.ts:20-21 (registration)Tool name listed in the STANDARD_TOOLS array within the agent manifest, used for agent discovery and capabilities reporting.
"google_health_daily_rollup", "google_health_daily_summary",