Skip to main content
Glama
TykanN

Swit MCP Server

by TykanN

swit-oauth-logout

Log out from Swit OAuth authentication and clear stored tokens to enable re-authentication.

Instructions

Logout from OAuth authentication and delete stored tokens. Use when re-authentication is required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handleOAuthLogout function is the main handler logic for 'swit-oauth-logout'. It checks if OAuthWebServer is available, calls oauthWebServer.getOAuthManager().logout() to clear tokens, and returns a success message.
    export const handleOAuthLogout = async (oauthWebServer: OAuthWebServer | null) => {
      if (!oauthWebServer) {
        return {
          error: 'OAuth web server is not available. Cannot perform logout.',
        };
      }
    
      oauthWebServer.getOAuthManager().logout();
    
      return {
        message: 'OAuth logout completed successfully.',
        note: 'Cached tokens have been cleared. Use swit-oauth-start to re-authenticate.',
      };
    };
  • The oauthHandlers object maps 'swit-oauth-logout' to a lambda that invokes handleOAuthLogout(oauthWebServer). This is where the tool name is wired to its handler function.
    export const oauthHandlers = (oauthWebServer: OAuthWebServer | null) => ({
      'swit-oauth-status': () => handleOAuthStatus(oauthWebServer),
      'swit-oauth-start': () => handleOAuthStart(oauthWebServer),
      'swit-oauth-logout': () => handleOAuthLogout(oauthWebServer),
    });
  • Tool registration for 'swit-oauth-logout' defining its name, description ('Logout from OAuth authentication and delete stored tokens...'), and inputSchema (empty Zod object).
    {
      name: 'swit-oauth-logout',
      description: 'Logout from OAuth authentication and delete stored tokens. Use when re-authentication is required.',
      inputSchema: zodToJsonSchema(EmptySchema),
    },
  • The OAuthManager.logout() method called by the handler. It sets tokenInfo to null and clears the token cache via tokenCache.clear().
    logout(): void {
      this.tokenInfo = null;
      this.tokenCache.clear();
      console.error('OAuth logout completed');
    }
  • The TokenCache.clear() method used during logout to delete the cached token file from disk.
    clear(): void {
      if (this.exists()) {
        fs.unlinkSync(this.filePath);
      }
    }
Behavior4/5

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

Given no annotations, the description discloses the destructive action of deleting tokens. It is clear about the side effect, though it could mention if any server-side invalidation occurs.

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?

Two concise sentences, front-loaded with the main action. Every word adds value, with no redundancy.

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

Completeness5/5

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

For a simple tool with no parameters, no output schema, and clear purpose, the description fully covers what an agent needs to know.

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 zero parameters, schema coverage is 100%. The description adds no parameter info as none are needed, meeting baseline for no-param tools.

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 uses specific verb 'logout' and resource 'OAuth authentication', clearly stating it deletes stored tokens. It distinguishes itself from other OAuth tools like swit-oauth-start and swit-oauth-status.

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

Usage Guidelines4/5

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

Explicitly states 'Use when re-authentication is required', providing clear context. Although it doesn't mention alternatives, the verb 'logout' is self-explanatory.

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/TykanN/swit-mcp'

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