get_activity_types
Retrieve the full list of activity types supported by Garmin Connect, such as running, cycling, and swimming, to categorize fitness activities.
Instructions
Get all available activity types (running, cycling, swimming, etc.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/activities.tools.ts:155-166 (handler)Registration and handler for the 'get_activity_types' tool. The tool handler calls client.getActivityTypes() and returns the result as JSON text.
server.registerTool( 'get_activity_types', { description: 'Get all available activity types (running, cycling, swimming, etc.)', }, async () => { const data = await client.getActivityTypes(); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/tools/activities.tools.ts:11-11 (registration)The 'registerActivityTools' function that registers tools on the MCP server. This is where 'get_activity_types' is registered via server.registerTool.
export function registerActivityTools(server: McpServer, client: GarminClient): void { - src/client/garmin.client.ts:247-249 (helper)Client method that fetches activity types by calling the Garmin API endpoint ACTIVITY_TYPES_ENDPOINT via this.request().
async getActivityTypes(): Promise<unknown> { return this.request(ACTIVITY_TYPES_ENDPOINT); } - The API endpoint constant for fetching activity types from Garmin Connect.
export const ACTIVITY_TYPES_ENDPOINT = '/activity-service/activity/activityTypes'; - src/dtos/write.dto.ts:24-24 (schema)Reference to get_activity_types as a cross-reference in the createManualActivitySchema for valid activityTypeKey values.
activityTypeKey: z.string().describe('Activity type key (e.g. running, cycling, swimming). Use get_activity_types to see all options'),