Skip to main content
Glama

auth_status

Verify user authentication status and retrieve basic profile information through the Microsoft Graph connection, ensuring secure access to Teams MCP server resources.

Instructions

Check the authentication status of the Microsoft Graph connection. Returns whether the user is authenticated and shows their basic profile information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'auth_status' tool. Calls graphService.getAuthStatus() and returns formatted text content indicating authentication status and user details.
    async () => { const status = await graphService.getAuthStatus(); return { content: [ { type: "text", text: status.isAuthenticated ? `✅ Authenticated as ${status.displayName || "Unknown User"} (${status.userPrincipalName || "No email available"})` : "❌ Not authenticated. Please run: npx @floriscornel/teams-mcp@latest authenticate", }, ], }; }
  • TypeScript interface defining the AuthStatus object used by the tool's handler and graphService.getAuthStatus().
    export interface AuthStatus { isAuthenticated: boolean; userPrincipalName?: string | undefined; displayName?: string | undefined; expiresAt?: string | undefined; }
  • src/tools/auth.ts:6-23 (registration)
    Registers the 'auth_status' tool on the MCP server with name, description, empty input schema {}, and inline handler.
    server.tool( "auth_status", "Check the authentication status of the Microsoft Graph connection. Returns whether the user is authenticated and shows their basic profile information.", {}, async () => { const status = await graphService.getAuthStatus(); return { content: [ { type: "text", text: status.isAuthenticated ? `✅ Authenticated as ${status.displayName || "Unknown User"} (${status.userPrincipalName || "No email available"})` : "❌ Not authenticated. Please run: npx @floriscornel/teams-mcp@latest authenticate", }, ], }; } );
  • GraphService.getAuthStatus() method: initializes the Graph client if needed, fetches current user info via /me endpoint, handles errors, and returns AuthStatus.
    async getAuthStatus(): Promise<AuthStatus> { await this.initializeClient(); if (!this.client) { return { isAuthenticated: false }; } try { const me = await this.client.api("/me").get(); return { isAuthenticated: true, userPrincipalName: me?.userPrincipalName ?? undefined, displayName: me?.displayName ?? undefined, expiresAt: this.authInfo?.expiresAt, }; } catch (error) { console.error("Error getting user info:", error); return { isAuthenticated: false }; } }
  • src/index.ts:132-132 (registration)
    Top-level call to registerAuthTools during MCP server startup, passing the server instance and GraphService singleton.
    registerAuthTools(server, graphService);

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/floriscornel/teams-mcp'

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