Skip to main content
Glama

clear_github_auth

Remove GitHub authentication to disconnect from GitHub accounts, clear stored credentials, or switch between user profiles.

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'clear_github_auth' MCP tool, including name, description, empty input schema, and handler 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()
    },
  • Core implementation of clearing GitHub auth: retrieves token if present, clears API cache, logs security event, removes stored token via TokenManager, and handles errors
    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);
      }
    }
  • TypeScript interface definition for the clearGitHubAuth method on IToolHandler
    clearGitHubAuth(): Promise<any>;
  • getAuthTools function that returns the array of auth tools including clear_github_auth for registration in ServerSetup
    export function getAuthTools(server: IToolHandler): Array<{ tool: ToolDefinition; handler: any }> {
      return [
        {
          tool: {
            name: "setup_github_auth",
            description: "Set up GitHub authentication to access all DollhouseMCP features. This uses GitHub's secure device flow - no passwords needed! Use this when users say things like 'connect to GitHub', 'set up GitHub', 'I have a GitHub account now', or when they try to submit content without authentication.",
            inputSchema: {
              type: "object",
              properties: {}
            }
          },
          handler: () => server.setupGitHubAuth()
        },
        {
          tool: {
            name: "check_github_auth", 
            description: "Check current GitHub authentication status. Shows whether you're connected to GitHub, your username, and what actions are available. Use when users ask 'am I connected to GitHub?', 'what's my GitHub status?', or similar questions.",
            inputSchema: {
              type: "object",
              properties: {}
            }
          },
          handler: () => server.checkGitHubAuth()
        },
        {
          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()
        },
        {
          tool: {
            name: "configure_oauth",
            description: "Configure GitHub OAuth client ID for authentication. If no client_id provided, shows current configuration status. If client_id provided, validates format and saves it to config. Use when users need to set up OAuth or check their configuration.",
            inputSchema: {
              type: "object",
              properties: {
                client_id: {
                  type: "string",
                  description: "GitHub OAuth client ID (starts with 'Ov23li' followed by at least 14 alphanumeric characters)"
                }
              }
            }
          },
          handler: (args: { client_id?: string }) => server.configureOAuth(args.client_id)
        },
        {
          tool: {
            name: "oauth_helper_status",
            description: "Get detailed diagnostic information about the OAuth helper process. Shows if authentication is in progress, process health, timing, and any errors. Use when troubleshooting authentication issues or checking if OAuth flow is working.",
            inputSchema: {
              type: "object",
              properties: {
                verbose: {
                  type: "boolean",
                  description: "Include detailed log output if available (default: false)"
                }
              }
            }
          },
          handler: (args: { verbose?: boolean }) => server.getOAuthHelperStatus(args.verbose)
        }
      ];
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses the destructive nature ('Remove', 'disconnect') but doesn't specify whether this requires user confirmation, what data gets cleared, or if it's reversible. The description adds some behavioral context but leaves gaps about implementation details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise with two sentences that each serve distinct purposes: the first states the tool's action, the second provides usage guidelines. Every word earns its place with zero wasted text, and it's front-loaded with the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with no output schema and no annotations, the description provides good context about what the tool does and when to use it. However, it doesn't explain what happens after disconnection or whether there are any side effects, leaving some behavioral questions unanswered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema description coverage, the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and the schema already fully documents this. No additional parameter information is needed or provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Remove GitHub authentication and disconnect from GitHub') and distinguishes it from sibling tools like 'check_github_auth' and 'setup_github_auth'. It uses precise verbs and identifies the exact resource being affected.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool, listing specific user phrases ('disconnect from GitHub', 'remove my GitHub connection', etc.) and scenarios (when users want to switch accounts). It clearly differentiates this from authentication setup or checking tools among its siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DollhouseMCP/DollhouseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server