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
| Name | Required | Description | Default |
|---|---|---|---|
| period | Yes | Goal period - either 'daily' or 'weekly' |
Implementation Reference
- src/activity-goals.ts:40-51 (handler)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}'` } ); }
- src/activity-goals.ts:35-39 (schema)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'") },
- src/activity-goals.ts:32-52 (registration)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}'` } ); } });