Skip to main content
Glama

verify-login

Check current Microsoft authentication status to verify login validity before accessing Microsoft 365 services across multiple tenants.

Instructions

Check current Microsoft authentication status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'verify-login' MCP tool, including its inline handler function. The handler calls authManager.testLogin() and returns the result as a text content block with JSON stringified output.
    server.tool('verify-login', 'Check current Microsoft authentication status', {}, async () => {
      const testResult = await authManager.testLogin();
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(testResult),
          },
        ],
      };
    });
  • The inline async handler function for the 'verify-login' tool that executes the core logic: tests login status via authManager and formats the response.
    server.tool('verify-login', 'Check current Microsoft authentication status', {}, async () => {
      const testResult = await authManager.testLogin();
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(testResult),
          },
        ],
      };
    });
  • Core helper method AuthManager.testLogin() that implements the login verification logic: acquires token, tests Graph /me endpoint, returns success status with user data or error message.
    async testLogin(): Promise<LoginTestResult> {
      try {
        logger.info('Testing login...');
        const token = await this.getToken();
    
        if (!token) {
          logger.error('Login test failed - no token received');
          return {
            success: false,
            message: 'Login failed - no token received',
          };
        }
    
        logger.info('Token retrieved successfully, testing Graph API access...');
    
        try {
          const response = await fetch('https://graph.microsoft.com/v1.0/me', {
            headers: {
              Authorization: `Bearer ${token}`,
            },
          });
    
          if (response.ok) {
            const userData = await response.json();
            logger.info('Graph API user data fetch successful');
            return {
              success: true,
              message: 'Login successful',
              userData: {
                displayName: userData.displayName,
                userPrincipalName: userData.userPrincipalName,
              },
            };
          } else {
            const errorText = await response.text();
            logger.error(`Graph API user data fetch failed: ${response.status} - ${errorText}`);
            return {
              success: false,
              message: `Login successful but Graph API access failed: ${response.status}`,
            };
          }
        } catch (graphError) {
          logger.error(`Error fetching user data: ${(graphError as Error).message}`);
          return {
            success: false,
            message: `Login successful but Graph API access failed: ${(graphError as Error).message}`,
          };
        }
      } catch (error) {
        logger.error(`Login test failed: ${(error as Error).message}`);
        return {
          success: false,
          message: `Login failed: ${(error as Error).message}`,
        };
      }
    }
  • TypeScript interface defining the structure of the login test result returned by testLogin(), used as output schema for the verify-login tool.
    interface LoginTestResult {
      success: boolean;
      message: string;
      userData?: {
        displayName: string;
        userPrincipalName: string;
      };
    }
  • src/server.ts:83-84 (registration)
    Call to registerAuthTools which includes registration of verify-login among other auth tools.
      registerAuthTools(this.server, this.authManager, this.graphClient);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool checks authentication status but doesn't disclose behavioral traits like what 'status' includes (e.g., logged in/out, token validity), whether it requires network calls, or potential error conditions. This leaves significant gaps for a tool that interacts with authentication systems.

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 a single, clear sentence that efficiently conveys the core function without unnecessary words. It's front-loaded with the essential action and resource, making it easy to parse. Every word earns its place, achieving ideal conciseness.

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

Completeness2/5

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

Given the complexity of authentication tools and lack of annotations or output schema, the description is incomplete. It doesn't explain what the check returns (e.g., boolean status, user details, error messages) or how it integrates with sibling tools. For a tool in this context, more detail is needed to guide effective use.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param details, which is appropriate, but it also doesn't compensate for any gaps since none exist. A baseline of 4 is given as the tool has no parameters to document.

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

Purpose4/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 a specific verb ('Check') and resource ('current Microsoft authentication status'), making it immediately understandable. However, it doesn't differentiate itself from sibling tools like 'login' or 'list-accounts', which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'login', 'logout', and 'list-accounts', it's unclear if this should be used before authentication attempts, to verify session validity, or as a status check. No explicit when/when-not instructions are given.

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/ForITLLC/m365-mcp-suite'

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