Skip to main content
Glama

get_device_solar_data

Retrieve solar charging data from your Garmin device for a specified date range. Monitor solar energy contribution to battery life.

Instructions

Get solar charging data for solar-equipped Garmin devices

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdYesThe Garmin device ID
startDateYesStart date in YYYY-MM-DD format
endDateYesEnd date in YYYY-MM-DD format

Implementation Reference

  • The handler function that executes the tool logic: makes an HTTP request to the Garmin Connect API endpoint for solar data, passing deviceId, startDate, endDate, and optionally a singleDayView flag.
    async getDeviceSolarData(deviceId: string, startDate: string, endDate: string): Promise<unknown> {
      const singleDay = startDate === endDate ? '&singleDayView=true' : '';
      return this.request(
        `${DEVICE_SOLAR_ENDPOINT}/${deviceId}?startDate=${startDate}&endDate=${endDate}${singleDay}`,
      );
    }
  • Input validation schema using Zod: defines deviceId (string), startDate and endDate (YYYY-MM-DD format strings).
    export const getDeviceSolarSchema = z.object({
      deviceId: z.string().describe('The Garmin device ID'),
      startDate: dateString.describe('Start date in YYYY-MM-DD format'),
      endDate: dateString.describe('End date in YYYY-MM-DD format'),
    });
  • Registration of the 'get_device_solar_data' tool on the MCP server with description and input schema, delegating to the client handler.
    server.registerTool(
      'get_device_solar_data',
      {
        description: 'Get solar charging data for solar-equipped Garmin devices',
        inputSchema: getDeviceSolarSchema.shape,
      },
      async ({ deviceId, startDate, endDate }) => {
        const data = await client.getDeviceSolarData(deviceId, startDate, endDate);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • Reusable Zod validation for date strings in YYYY-MM-DD format, used by the device solar schema.
    import { z } from 'zod';
    
    export const dateString = z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'Must be YYYY-MM-DD format');
  • API endpoint constant DEVICE_SOLAR_ENDPOINT = '/web-gateway/solar' used by the handler to make the HTTP request.
    export const DEVICE_SOLAR_ENDPOINT = '/web-gateway/solar';
Behavior3/5

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

The description implies a read-only operation ('Get...') which is standard, but no additional behavioral traits are disclosed (e.g., error cases for non-solar devices, rate limits, or data granularity). With no annotations, the description carries the full burden for transparency, and this is minimally adequate.

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 (7 words) that effectively conveys the tool's purpose without any unnecessary words or repetition. It is well-suited for quick comprehension.

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 the tool's simplicity and full schema coverage, the description provides adequate context for basic usage. However, it lacks information about the output format (no output schema) and does not address potential error scenarios or data availability, leaving room for improvement.

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?

All three parameters (deviceId, startDate, endDate) have clear descriptions in the input schema (100% coverage). The tool description adds no extra semantic value beyond what the schema already provides, so a baseline score of 3 is appropriate.

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 identifies the verb (Get), resource (solar charging data), and context (solar-equipped Garmin devices). It is specific and unambiguous, effectively distinguishing this tool from the many other 'get_*' siblings on the server.

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 is provided on when to use this tool versus alternatives, nor are there prerequisites or exclusions mentioned. While the tool is unique among siblings, the description lacks explicit usage context, such as noting that the device must be solar-equipped or that dates are required.

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