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}'` } ); } });

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