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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/oauth.handlers.ts:3-15 (handler)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.', }; };
- src/tools/oauth.tools.ts:7-11 (schema)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), },
- src/handlers/oauth.handlers.ts:62-66 (registration)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), });
- src/tools/oauth.tools.ts:6-22 (registration)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), }, ];