Skip to main content
Glama

swit-oauth-status

Verify the status of OAuth authentication for the Swit MCP Server to ensure secure access to Swit workspaces, channels, and messages.

Instructions

Check OAuth authentication status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the core logic of the 'swit-oauth-status' tool. It checks if the user is authenticated via OAuthWebServer and returns the status, web server URL, and instructional message.
    export const handleOAuthStatus = async (oauthWebServer: OAuthWebServer | null) => { const isAuthenticated = oauthWebServer?.isAuthenticated() || false; const port = process.env.OAUTH_PORT || '3000'; return { authenticated: isAuthenticated, status: isAuthenticated ? 'Authenticated' : 'Authentication required', webServerUrl: oauthWebServer ? `http://localhost:${port}` : null, message: isAuthenticated ? 'OAuth authentication completed. Swit API is ready to use.' : 'OAuth authentication required. Use swit-oauth-start tool to begin authentication.', }; };
  • The schema definition for the 'swit-oauth-status' tool, specifying its name, description, and empty input schema (no parameters required).
    { name: 'swit-oauth-status', description: 'Check OAuth authentication status', inputSchema: zodToJsonSchema(EmptySchema), },
  • The registration of OAuth tool handlers, mapping the tool name 'swit-oauth-status' 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), });
  • The array exporting the OAuth tools definitions, including the 'swit-oauth-status' tool schema.
    export const oauthTools = [ { name: 'swit-oauth-status', description: 'Check OAuth authentication status', inputSchema: zodToJsonSchema(EmptySchema), }, { name: 'swit-oauth-start', description: 'Start OAuth authentication. Returns authentication URL that can be opened in browser.', inputSchema: zodToJsonSchema(EmptySchema), }, { name: 'swit-oauth-logout', description: 'Logout from OAuth authentication and delete stored tokens. Use when re-authentication is required.', inputSchema: zodToJsonSchema(EmptySchema), }, ];

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