Skip to main content
Glama

get_stress_range

Retrieve daily stress levels for a specified date range, returning each day's stress data.

Instructions

Get daily stress 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_stress_range' tool on the MCP server with description, input schema, and handler that delegates to the Garmin client.
    server.registerTool(
      'get_stress_range',
      {
        description:
          'Get daily stress data over a date range (day-by-day). Returns array of {date, data} records',
        inputSchema: dateRangeParamSchema.shape,
      },
      async ({ startDate, endDate }) => {
        const data = await client.getStressRange(startDate, endDate);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • Client-side handler that fetches stress data over a date range, calling fetchRange with the getStress fetcher.
    async getStressRange(startDate: string, endDate: string): Promise<{ date: string; data: unknown }[]> {
      return this.fetchRange(startDate, endDate, (d) => this.getStress(d));
    }
  • Generic helper that iterates over a date range and calls a fetcher function for each day, collecting results.
    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;
    }
  • Single-day stress fetcher that makes an API request to the daily stress endpoint.
    async getStress(date?: string): Promise<unknown> {
      const resolvedDate = date ?? todayString();
      return this.request(`${DAILY_STRESS_ENDPOINT}/${resolvedDate}`);
    }
  • Zod schema defining the input parameters (startDate, endDate) for the get_stress_range tool.
    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 full burden. It only discloses the return format as an array of records but does not mention any behavioral traits such as rate limits, authentication needs, or what the 'data' field contains.

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 front-loads the purpose and scope with no 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?

For a simple tool with two parameters and no output schema, the description is moderately complete. However, it lacks details about the 'data' field's contents, leaving ambiguity in the return structure.

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% with both parameters described in the schema. The description does not add extra meaning beyond the schema; it merely reiterates 'date range'.

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 'daily stress data', and the scope 'over a date range (day-by-day)', distinguishing it from siblings like get_stress (single day) and get_weekly_stress.

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 usage for date ranges but does not explicitly mention when not to use it or suggest alternatives like get_stress or get_weekly_stress. Given many sibling tools, explicit guidance would be beneficial.

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