Skip to main content
Glama

get_weekly_steps

Retrieve weekly step totals for trend analysis over up to 52 weeks. Specify an end date to get historical step counts.

Instructions

Get weekly aggregated step counts for trend analysis. Defaults to 52 weeks (1 year). Max 52 weeks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endDateYesEnd date in YYYY-MM-DD format
weeksNoNumber of weeks to look back (1-52). Defaults to 52 (full year)

Implementation Reference

  • Tool registration for 'get_weekly_steps' on the MCP server. Defines schema via weeklyParamSchema and handler that calls client.getWeeklySteps().
    server.registerTool(
      'get_weekly_steps',
      {
        description:
          'Get weekly aggregated step counts for trend analysis. Defaults to 52 weeks (1 year). Max 52 weeks',
        inputSchema: weeklyParamSchema.shape,
      },
      async ({ endDate, weeks }) => {
        const data = await client.getWeeklySteps(endDate, weeks ?? 52);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • Handler function for get_weekly_steps tool. Receives { endDate, weeks }, defaults weeks to 52, calls client.getWeeklySteps(), and returns JSON-stringified response.
    async ({ endDate, weeks }) => {
      const data = await client.getWeeklySteps(endDate, weeks ?? 52);
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
      };
    },
  • Client method getWeeklySteps() – makes the actual API request to the Garmin weekly steps endpoint.
    async getWeeklySteps(endDate: string, weeks = 52): Promise<unknown> {
      return this.request(`${WEEKLY_STEPS_ENDPOINT}/${endDate}/${weeks}`);
    }
  • weeklyParamSchema – Zod schema defining input: endDate (string, YYYY-MM-DD) and weeks (optional number, 1-52, default 52).
    export const weeklyParamSchema = z.object({
      endDate: dateString.describe('End date in YYYY-MM-DD format'),
      weeks: z
        .number()
        .min(1)
        .max(52)
        .default(52)
        .optional()
        .describe('Number of weeks to look back (1-52). Defaults to 52 (full year)'),
    });
  • WEEKLY_STEPS_ENDPOINT constant – the Garmin API path '/usersummary-service/stats/steps/weekly' used by the client.
    export const WEEKLY_STEPS_ENDPOINT = '/usersummary-service/stats/steps/weekly';
Behavior2/5

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

No annotations provided; description does not declare read-only nature, rate limits, or any side effects. Only states aggregation and date range, missing crucial behavioral context for a tool with no annotations.

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?

Extremely concise: two sentences conveying purpose, default, and max range without redundancy. 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?

Given tool simplicity (2 params, no output schema), description is mostly complete. Lacks return format details but sufficient for basic use. Slightly incomplete due to missing output description.

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 detailed parameter descriptions. The description adds no new information beyond the schema (default/max weeks already in schema). Baseline 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?

Description clearly states 'Get weekly aggregated step counts for trend analysis', specifying the verb, resource (weekly step counts), and purpose (trend analysis). Distinguishes from siblings like get_steps (daily) and get_steps_chart (raw data) by focusing on weekly aggregation.

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

Usage Guidelines4/5

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

Implies usage for trend analysis with weekly data, and specifies defaults/max weeks. However, lacks explicit guidance on when to use this tool versus alternatives like get_steps or get_daily_summary.

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