Skip to main content
Glama

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] }; });

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