Skip to main content
Glama

get_respiration_range

Retrieve daily respiration data for a specified date range. Returns array of dates and respiration records.

Instructions

Get respiration 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

  • Registration of the 'get_respiration_range' tool on the MCP server with inputSchema from dateRangeParamSchema and a handler that calls client.getRespirationRange
    server.registerTool(
      'get_respiration_range',
      {
        description:
          'Get respiration data over a date range (day-by-day). Returns array of {date, data} records',
        inputSchema: dateRangeParamSchema.shape,
      },
      async ({ startDate, endDate }) => {
        const data = await client.getRespirationRange(startDate, endDate);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • Handler method on GarminClient that calls fetchRange to iterate over dates and fetch respiration data for each date
    async getRespirationRange(startDate: string, endDate: string): Promise<{ date: string; data: unknown }[]> {
      return this.fetchRange(startDate, endDate, (d) => this.getRespiration(d));
    }
  • Helper method fetchRange that iterates from startDate to endDate, calls the fetcher callback for each date, and collects results as {date, data} records
    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;
    }
  • The underlying getRespiration method that fetches a single day's respiration data from the Garmin API endpoint
    async getRespiration(date?: string): Promise<unknown> {
      const resolvedDate = date ?? todayString();
      return this.request(`${DAILY_RESPIRATION_ENDPOINT}/${resolvedDate}`);
    }
  • The dateRangeParamSchema used as inputSchema for the tool, 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'),
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the return format but does not disclose data units, range limits, or any behavioral traits beyond the basic read operation.

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 a single concise sentence that effectively communicates the tool's purpose and return structure without unnecessary words.

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

Completeness3/5

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

Given no output schema, the description provides the return format, but lacks specification of the data field's contents (e.g., units) and any constraints on the date range.

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 the return format but does not provide additional meaning for the parameters themselves beyond what the schema already states.

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

Purpose5/5

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

The description clearly states the verb 'Get', the resource 'respiration data', and the scope 'over a date range (day-by-day)'. It distinguishes from siblings like 'get_respiration' which likely returns single-day data.

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 does not explicitly state when to use this tool versus alternatives. While the name implies a range query, no when-not or alternative tools are mentioned.

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