Skip to main content
Glama

get_sleep_data_raw

Retrieve raw sleep data for a specified date, including detailed heart rate and SpO2 measurements.

Instructions

Get raw sleep data directly from the wellness service with full detail including heart rate and SpO2 during sleep

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoDate in YYYY-MM-DD format. Defaults to today if not provided

Implementation Reference

  • MCP tool registration for 'get_sleep_data_raw' — registers the tool with a description and input schema, linking to GarminClient.getSleepDataRaw handler
    server.registerTool(
      'get_sleep_data_raw',
      {
        description:
          'Get raw sleep data directly from the wellness service with full detail including heart rate and SpO2 during sleep',
        inputSchema: dateParamSchema.shape,
      },
      async ({ date }) => {
        const data = await client.getSleepDataRaw(date);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • Client method that executes the actual API call — hits the wellness daily sleep endpoint with only the date param (no nonSleepBufferMinutes), returning the raw data
    async getSleepDataRaw(date?: string): Promise<unknown> {
      const resolvedDate = date ?? todayString();
      return this.request(`${SLEEP_DAILY_ENDPOINT}/${this.displayName}?date=${resolvedDate}`);
    }
  • Input schema (Zod) for the tool — an optional date string in YYYY-MM-DD format, defaults to today
    export const dateParamSchema = z.object({
      date: dateString
        .optional()
        .describe('Date in YYYY-MM-DD format. Defaults to today if not provided'),
    });
  • Zod validation regex ensuring date string is in YYYY-MM-DD format
    export const dateString = z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'Must be YYYY-MM-DD format');
  • API endpoint constant pointing to the Garmin wellness daily sleep data service
    export const SLEEP_DAILY_ENDPOINT = '/wellness-service/wellness/dailySleepData';
Behavior2/5

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

With no annotations, the description carries full burden but fails to disclose response format, error handling, or limitations. It only states 'directly from the wellness service', which is vague.

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

Conciseness4/5

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

The description is a single concise sentence that front-loads the key action, but could be slightly improved by including more usage context.

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 no output schema and no annotations, the description lacks crucial information about the return value and behavior, making it insufficient for a data retrieval tool.

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?

Although the schema covers the 'date' parameter with pattern and description, the description adds no additional meaning or context about the parameter.

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 tool gets raw sleep data with full detail including heart rate and SpO2, distinguishing it from the sibling 'get_sleep_data' which likely provides summary 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 implies use when needing full detail, but does not explicitly mention when to avoid or compare with alternatives like 'get_sleep_data' or 'get_sleep_data_range'.

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