Skip to main content
Glama

get_hrv_range

Retrieve heart rate variability data for a date range, returned as day-by-day records with dates and values. Analyze daily HRV trends.

Instructions

Get HRV data over a date range (day-by-day). Returns array of {date, data} records

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format

Implementation Reference

  • The core 'getHRV' async method that fetches HRV data from the Garmin API endpoint for a given date. This is the underlying API call used by getHRVRange.
    async getHRV(date?: string): Promise<unknown> {
      const resolvedDate = date ?? todayString();
      return this.request(`${HRV_ENDPOINT}/${resolvedDate}`);
    }
  • The 'getHRVRange' method on GarminClient that iterates over a date range and fetches HRV data for each day via fetchRange.
    async getHRVRange(startDate: string, endDate: string): Promise<{ date: string; data: unknown }[]> {
      return this.fetchRange(startDate, endDate, (d) => this.getHRV(d));
    }
  • The tool registration for 'get_hrv_range' using server.registerTool, mapping to client.getHRVRange with dateRangeParamSchema input.
    server.registerTool(
      'get_hrv_range',
      {
        description:
          'Get HRV data over a date range (day-by-day). Returns array of {date, data} records',
        inputSchema: dateRangeParamSchema.shape,
      },
      async ({ startDate, endDate }) => {
        const data = await client.getHRVRange(startDate, endDate);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • The input schema (dateRangeParamSchema) used by get_hrv_range, defining startDate and endDate as YYYY-MM-DD strings.
    export const dateRangeParamSchema = z.object({
      startDate: dateString.describe('Start date in YYYY-MM-DD format'),
      endDate: dateString.describe('End date in YYYY-MM-DD format'),
    });
  • The private fetchRange helper that generates a list of dates and fetches data for each date via the provided fetcher callback.
    private async fetchRange(
      startDate: string,
      endDate: string,
      fetcher: (date: string) => Promise<unknown>,
    ): Promise<{ date: string; data: unknown }[]> {
      const dates = this.dateRange(startDate, endDate);
      const results: { date: string; data: unknown }[] = [];
      for (const date of dates) {
        const data = await fetcher(date).catch(() => null);
        results.push({ date, data });
      }
      return results;
    }
Behavior3/5

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

No annotations provided, so description must carry transparency. It implies a read operation and specifies return format, but does not explicitly state read-only or disclose any side effects.

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?

Single sentence with no fluff, directly conveying action, scope, and return format. Every word adds value.

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

Completeness4/5

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

No output schema, but description explains return structure as array of {date, data} records. Lacks detail on 'data' field contents, but sufficient for a simple data retrieval tool.

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

Parameters3/5

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

Schema coverage is 100%, and the description adds no additional meaning beyond the schema. The parameters are self-explanatory from schema descriptions.

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 it retrieves HRV data over a date range, day-by-day, and returns array records. It distinguishes from sibling 'get_hrv' by specifying range and daily granularity, though not explicitly naming the alternative.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus similar range tools (e.g., get_stress_range) or the singular get_hrv. The description does not provide context for selection.

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/Nicolasvegam/garmin-connect-mcp'

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