validate_connection
Test the connection to LibreLinkUp servers and verify credentials are working. Use this to diagnose errors or after updating credentials.
Instructions
Test the connection to LibreLinkUp servers and verify your credentials are working. Use this if you encounter errors or after updating credentials.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/librelink-client.ts:455-462 (handler)The actual implementation of validateConnection - tries getCurrentGlucose(), returns true on success, false on error.
async validateConnection(): Promise<boolean> { try { await this.getCurrentGlucose(); return true; } catch { return false; } } - src/index.ts:204-215 (schema)Schema definition for validate_connection tool, with no required input parameters and readOnlyHint.
{ name: 'validate_connection', description: 'Test the connection to LibreLinkUp servers and verify your credentials are working. Use this if you encounter errors or after updating credentials.', inputSchema: { type: 'object', properties: {}, required: [] }, annotations: { readOnlyHint: true } }, - src/index.ts:411-436 (handler)The MCP tool handler for 'validate_connection' case - calls client.validateConnection() and returns formatted result.
case 'validate_connection': { if (!client) { throw new Error('LibreLinkUp not configured. Use configure_credentials first.'); } const isValid = await client.validateConnection(); if (isValid) { const glucose = await client.getCurrentGlucose(); const sessionStatus = client.getSessionStatus(); return { content: [{ type: 'text', text: `LibreLinkUp connection validated successfully!\n\nCurrent glucose: ${glucose.value} mg/dL (${glucose.trend})\n\nSession status:\n- Authenticated: ${sessionStatus.authenticated}\n- Token valid: ${sessionStatus.tokenValid}\n- Expires: ${sessionStatus.expiresAt?.toISOString() || 'N/A'}` }] }; } else { return { content: [{ type: 'text', text: 'LibreLinkUp connection failed. Please check:\n1. Your credentials are correct\n2. You have accepted Terms & Conditions in LibreLinkUp app\n3. Someone is sharing data with you (or you shared your own)' }] }; } } - src/index.ts:204-215 (registration)Tool registration entry in the tools array listing validate_connection.
{ name: 'validate_connection', description: 'Test the connection to LibreLinkUp servers and verify your credentials are working. Use this if you encounter errors or after updating credentials.', inputSchema: { type: 'object', properties: {}, required: [] }, annotations: { readOnlyHint: true } },