get_badge_challenges
Retrieve a list of completed badge challenges from your Garmin Connect account.
Instructions
Get completed badge challenges
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/challenges.tools.ts:31-42 (registration)Registration of the 'get_badge_challenges' tool via server.registerTool, with description 'Get completed badge challenges' and a handler that calls client.getBadgeChallenges().
server.registerTool( 'get_badge_challenges', { description: 'Get completed badge challenges', }, async () => { const data = await client.getBadgeChallenges(); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/client/garmin.client.ts:582-584 (handler)Handler function getBadgeChallenges() in GarminClient class that executes the API request to the badge challenges endpoint.
async getBadgeChallenges(): Promise<unknown> { return this.request(BADGE_CHALLENGES_ENDPOINT); } - Endpoint constant BADGE_CHALLENGES_ENDPOINT defining the API URL path for completed badge challenges.
export const BADGE_CHALLENGES_ENDPOINT = '/badgechallenge-service/badgeChallenge/completed'; export const AVAILABLE_BADGE_CHALLENGES_ENDPOINT = '/badgechallenge-service/badgeChallenge/available'; export const NON_COMPLETED_BADGE_CHALLENGES_ENDPOINT = '/badgechallenge-service/badgeChallenge/non-completed'; - src/client/garmin.client.ts:74-77 (helper)Import and usage of the BADGE_CHALLENGES_ENDPOINT constant in the client imports.
BADGE_CHALLENGES_ENDPOINT, AVAILABLE_BADGE_CHALLENGES_ENDPOINT, NON_COMPLETED_BADGE_CHALLENGES_ENDPOINT, INPROGRESS_VIRTUAL_CHALLENGES_ENDPOINT,