Skip to main content
Glama
davidmosiah

Google Health MCP

by davidmosiah

Google Health Daily Rollup

google_health_daily_rollup
Read-onlyIdempotent

Aggregate 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

TableJSON Schema
NameRequiredDescriptionDefault
data_typeNoGoogle Health data type in kebab case, e.g. steps, sleep, heart-rate, daily-resting-heart-rate.steps
start_dateNotoday
end_dateNoExclusive end date as YYYY-MM-DD. Defaults to the next day.today
window_size_daysNo
page_sizeNo
page_tokenNo
data_source_familyNo
privacy_modeNoOptional per-call privacy override. Defaults to GOOGLE_HEALTH_PRIVACY_MODE or structured. raw returns upstream Google Health JSON.
response_formatNomarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYes
privacy_modeYes
dataYes

Implementation Reference

  • 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);
      }
    });
  • 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;
    }
  • 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",
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true, so the description's brief 'aggregate' is consistent but adds little new behavioral context. It does not disclose pagination details, rate limits, or response structure beyond what is obvious from the name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, using only two sentences with no unnecessary words. It front-loads the core action and examples.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 9 optional parameters and an output schema, the description lacks guidance on how to use date ranges, pagination, or parameter combinations. It is not sufficient for an agent to invoke this tool correctly without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema description coverage at only 33%, the description should compensate by explaining parameters, but it only lists a few example data types. It does not clarify defaults like start_date='today' or end_date meaning, nor the role of page_size or window_size_days.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'aggregate' and the resource 'data type over civil days', and lists specific use cases like steps, distance, calories. However, it does not differentiate from sibling tools such as 'google_health_daily_summary' or 'google_health_rollup', leaving potential ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use by listing example data types, but it does not provide explicit guidance on when not to use this tool or alternatives. There is no mention of prerequisites or comparison with other tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/davidmosiah/google-health-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server