check_garmin_auth
Verify Garmin Connect authentication status to ensure workout creation and device synchronization functions properly.
Instructions
Check if Garmin authentication is valid
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-server.ts:187-220 (handler)The handler function for the 'check_garmin_auth' tool. It checks Garmin authentication validity using garminAuth.getValidAuth(), formats the expiration date, and returns a text response indicating if authentication is valid or not, with error handling.case "check_garmin_auth": { try { const authData = await garminAuth.getValidAuth(); if (authData) { const expiresAt = new Date(authData.expiresAt); return { content: [ { type: "text", text: `✅ Garmin authentication is valid and ready to use.\nToken expires: ${expiresAt.toLocaleString()}`, }, ], }; } else { return { content: [ { type: "text", text: "❌ No valid Garmin authentication found. Please run the 'authenticate_garmin' tool to authenticate.", }, ], }; } } catch (error) { return { content: [ { type: "text", text: `❌ Authentication error: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } }
- src/mcp-server.ts:91-98 (registration)Registration of the 'check_garmin_auth' tool in the ListTools response, including name, description, and empty input schema.{ name: "check_garmin_auth", description: "Check if Garmin authentication is valid", inputSchema: { type: "object", properties: {}, }, },
- src/mcp-server.ts:94-97 (schema)Input schema for the 'check_garmin_auth' tool, which takes no parameters.inputSchema: { type: "object", properties: {}, },