Skip to main content
Glama
TykanN

Swit MCP Server

by TykanN

swit-oauth-logout

Log out from OAuth authentication and delete stored tokens to enable re-authentication for the Swit MCP Server.

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 main execution logic for the 'swit-oauth-logout' tool. Checks if the OAuth web server is available, invokes logout on the OAuth manager, and returns a success response.
    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.',
      };
    };
  • Tool schema definition including name, description, and empty input schema (no parameters required).
    {
      name: 'swit-oauth-logout',
      description: 'Logout from OAuth authentication and delete stored tokens. Use when re-authentication is required.',
      inputSchema: zodToJsonSchema(EmptySchema),
    },
  • Factory function creating the handlers object that maps 'swit-oauth-logout' to its execution function.
    export const oauthHandlers = (oauthWebServer: OAuthWebServer | null) => ({
      'swit-oauth-status': () => handleOAuthStatus(oauthWebServer),
      'swit-oauth-start': () => handleOAuthStart(oauthWebServer),
      'swit-oauth-logout': () => handleOAuthLogout(oauthWebServer),
    });
  • src/index.ts:109-109 (registration)
    Registers the OAuth handlers (including 'swit-oauth-logout') into the global toolHandlers map used by the MCP server's CallToolRequestSchema handler.
    toolHandlers = { ...oauthHandlers(oauthWebServer), ...coreHandlers(switClient) };
  • src/index.ts:61-63 (registration)
    Registers the listTools handler that exposes the tool schemas, including 'swit-oauth-logout', to MCP clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: [...oauthTools, ...coreTools] };
    });
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the tool's behavior by stating it 'delete[s] stored tokens,' which implies a destructive operation. However, it lacks details on permissions needed, side effects (e.g., impact on other tools), or error handling. The description adds some value but is incomplete for behavioral context.

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 two concise sentences with zero waste. The first sentence states the purpose, and the second provides usage guidelines, making it front-loaded and efficiently structured.

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?

Given the tool's complexity (simple logout with no parameters) and lack of annotations or output schema, the description is reasonably complete. It covers purpose and usage but could benefit from more behavioral details (e.g., confirmation of logout success). However, it adequately addresses the core functionality for this context.

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?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description does not add parameter semantics beyond the schema, but this is appropriate. Baseline for 0 parameters is 4, as the description focuses on purpose and usage instead.

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 tool's purpose with specific verbs ('logout', 'delete stored tokens') and identifies the resource ('OAuth authentication'). It distinguishes from sibling tools like 'swit-oauth-start' and 'swit-oauth-status' by focusing on ending authentication rather than initiating or checking it.

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 explicitly states when to use this tool: 'Use when re-authentication is required.' This provides clear context for usage and implies an alternative (re-authentication via other OAuth tools) without naming specific 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/TykanN/swit-mcp'

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