clear_github_auth
Remove GitHub authentication to disconnect your account or switch profiles. This action clears active GitHub connections, enabling seamless transitions between accounts or integrations.
Instructions
Remove GitHub authentication and disconnect from GitHub. Use when users say 'disconnect from GitHub', 'remove my GitHub connection', 'clear authentication', or want to switch accounts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server/tools/AuthTools.ts:32-42 (registration)Tool registration including name, description, input schema (empty object), and handler function that delegates to server.clearGitHubAuth(){ tool: { name: "clear_github_auth", description: "Remove GitHub authentication and disconnect from GitHub. Use when users say 'disconnect from GitHub', 'remove my GitHub connection', 'clear authentication', or want to switch accounts.", inputSchema: { type: "object", properties: {} } }, handler: () => server.clearGitHubAuth() },
- src/server/types.ts:50-50 (schema)TypeScript interface declaration for the clearGitHubAuth method on IToolHandlerclearGitHubAuth(): Promise<any>;
- Core logic for clearing GitHub authentication: removes stored token, clears API cache, logs security event. Likely invoked by server.clearGitHubAuth() implementation.async clearAuthentication(): Promise<void> { try { // Get the token before clearing it const token = await TokenManager.getGitHubTokenAsync(); if (token) { // Attempt to revoke the token on GitHub // Note: GitHub OAuth tokens don't have a revocation endpoint for device flow tokens // But we'll clear the cache and remove from storage // Clear cached user info this.apiCache.clear(); // Log security event for audit trail SecurityMonitor.logSecurityEvent({ type: 'TOKEN_CACHE_CLEARED', severity: 'LOW', source: 'GitHubAuthManager.clearAuthentication', details: 'GitHub authentication cleared by user request', metadata: { hadToken: true, tokenPrefix: TokenManager.getTokenPrefix(token) } }); } // Remove from secure storage await TokenManager.removeStoredToken(); logger.info('GitHub authentication cleared successfully'); } catch (error) { ErrorHandler.logError('GitHubAuthManager.clearAuthentication', error); throw ErrorHandler.createError('Failed to clear authentication', ErrorCategory.AUTH_ERROR, undefined, error); } }
- src/server/ServerSetup.ts:65-66 (registration)Registers all auth tools (including clear_github_auth) from AuthTools into the central ToolRegistry during server setup// Register auth tools this.toolRegistry.registerMany(getAuthTools(instance));