Skip to main content
Glama

auth_status

Verify Microsoft Graph authentication status and retrieve basic user profile information to confirm connection readiness for Teams interactions.

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

  • src/tools/auth.ts:4-24 (registration)
    Registers the 'auth_status' tool on the MCP server, including name, description, empty input schema, and inline handler function.
    export function registerAuthTools(server: McpServer, graphService: GraphService) { // Authentication status tool 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", }, ], }; } ); }
  • The executor function for the auth_status tool. Fetches status from GraphService and returns formatted text response in MCP content format.
    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 structure of the authentication status object used by the tool.
    export interface AuthStatus { isAuthenticated: boolean; userPrincipalName?: string | undefined; displayName?: string | undefined; expiresAt?: string | undefined; }
  • Core utility method in GraphService that initializes the client from stored auth token, checks expiration, queries Microsoft Graph /me endpoint, 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 }; } }

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