get_fitness_age
Retrieve your Garmin Fitness Age estimate calculated from your fitness level, activity data, and body metrics.
Instructions
Get Garmin Fitness Age estimate based on fitness level, activity, and body metrics
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date in YYYY-MM-DD format. Defaults to today if not provided |
Implementation Reference
- src/tools/performance.tools.ts:116-128 (handler)Registration + handler for the 'get_fitness_age' MCP tool. Calls client.getFitnessAge(date) and returns the JSON response as text content.
server.registerTool( 'get_fitness_age', { description: 'Get Garmin Fitness Age estimate based on fitness level, activity, and body metrics', inputSchema: dateParamSchema.shape, }, async ({ date }) => { const data = await client.getFitnessAge(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/client/garmin.client.ts:430-433 (handler)Client method getFitnessAge that resolves the date (defaults to today) and makes a request to the FITNESS_AGE_ENDPOINT.
async getFitnessAge(date?: string): Promise<unknown> { const resolvedDate = date ?? todayString(); return this.request(`${FITNESS_AGE_ENDPOINT}/${resolvedDate}`); } - src/dtos/date-params.dto.ts:8-12 (schema)Schema definition for the input parameter 'date' (optional YYYY-MM-DD string, defaults to today). Used as inputSchema for get_fitness_age.
export const dateParamSchema = z.object({ date: dateString .optional() .describe('Date in YYYY-MM-DD format. Defaults to today if not provided'), }); - src/tools/performance.tools.ts:10-10 (registration)The registerPerformanceTools function that receives the server and client, and registers all performance tools including get_fitness_age.
export function registerPerformanceTools(server: McpServer, client: GarminClient): void { - API endpoint constant: FITNESS_AGE_ENDPOINT = '/fitnessage-service/fitnessage' used by the client method.
export const FITNESS_AGE_ENDPOINT = '/fitnessage-service/fitnessage';