Skip to main content
Glama

get_activity_goals

Retrieve Fitbit activity goals for daily or weekly periods, including steps, distance, calories, floors, and active minutes, to track fitness progress.

Instructions

Get the raw JSON response for user's activity goals from Fitbit. Supports 'daily' and 'weekly' periods. Returns goal values for steps, distance, calories, floors, active minutes, and active zone minutes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYesGoal period - either 'daily' or 'weekly'

Implementation Reference

  • The handler function for the 'get_activity_goals' tool. It constructs the Fitbit API endpoint based on the period parameter and calls the shared handleFitbitApiCall utility to perform the API request.
    handler: async ({ period }: ActivityGoalsParams) => {
      const endpoint = `activities/goals/${period}.json`;
      
      return handleFitbitApiCall<ActivityGoalsResponse, ActivityGoalsParams>(
        endpoint,
        { period },
        getAccessTokenFn,
        {
          errorContext: `period '${period}'`
        }
      );
    }
  • Input schema for the 'get_activity_goals' tool using Zod, defining the 'period' parameter as an enum of 'daily' or 'weekly'.
    parametersSchema: {
      period: z
        .enum(['daily', 'weekly'])
        .describe("Goal period - either 'daily' or 'weekly'")
    },
  • Registration of the 'get_activity_goals' tool using registerTool, including name, description, schema, and handler.
    registerTool(server, {
      name: 'get_activity_goals',
      description: "Get the raw JSON response for user's activity goals from Fitbit. Supports 'daily' and 'weekly' periods. Returns goal values for steps, distance, calories, floors, active minutes, and active zone minutes.",
      parametersSchema: {
        period: z
          .enum(['daily', 'weekly'])
          .describe("Goal period - either 'daily' or 'weekly'")
      },
      handler: async ({ period }: ActivityGoalsParams) => {
        const endpoint = `activities/goals/${period}.json`;
        
        return handleFitbitApiCall<ActivityGoalsResponse, ActivityGoalsParams>(
          endpoint,
          { period },
          getAccessTokenFn,
          {
            errorContext: `period '${period}'`
          }
        );
      }
    });
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the return format ('raw JSON response') and data fields included, but doesn't mention authentication requirements, rate limits, error conditions, or whether this is a read-only operation. It adds some behavioral context but leaves significant gaps.

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?

Two sentences with zero waste. First sentence states purpose and scope, second sentence details return content. Every word earns its place and information is front-loaded appropriately.

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 single-parameter read operation with no output schema, the description covers purpose and return content adequately. However, without annotations, it should ideally mention that this is a read-only operation and any authentication requirements. The description is complete enough for basic use but lacks operational context.

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 description coverage is 100%, so the schema already fully documents the single 'period' parameter with its enum values. The description mentions period support but adds no additional semantic meaning beyond what the schema provides. Baseline 3 is appropriate when schema does the heavy lifting.

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 specific action ('Get the raw JSON response'), resource ('user's activity goals from Fitbit'), and scope ('daily' and 'weekly' periods). It distinguishes from siblings by focusing on goals rather than timeseries, summaries, exercises, or other data types.

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 retrieving goal data with period selection, but provides no explicit guidance on when to use this tool versus alternatives like get_activity_timeseries or get_daily_activity_summary. No exclusions or prerequisites 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/TheDigitalNinja/mcp-fitbit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server