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 };
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool returns (authentication status and basic profile info) but doesn't mention error conditions, rate limits, or what happens when authentication fails. The description adds value by specifying the return content but lacks comprehensive behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise - two sentences that directly state what the tool does and what it returns. Every word earns its place with zero waste or redundancy. The information is front-loaded with the core purpose stated immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple authentication status check tool with no parameters and no output schema, the description is adequate but has gaps. It explains what information is returned but doesn't specify the format or structure of the response. Given the lack of annotations and output schema, more detail about the return format would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't waste space discussing non-existent parameters and focuses on the tool's function instead.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('check', 'returns') and resources ('authentication status', 'Microsoft Graph connection', 'basic profile information'). It distinguishes itself from siblings like 'get_current_user' by focusing specifically on authentication status rather than general user data retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool - to check authentication status and get basic profile info. However, it doesn't explicitly state when NOT to use it or mention specific alternatives like 'get_current_user' for more detailed user information, which prevents a perfect score.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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