Skip to main content
Glama

verify-login

Check your current authentication status with Microsoft 365 to confirm you are logged in and have access to Microsoft services.

Instructions

Check current Microsoft authentication status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler function for the 'verify-login' tool. Calls authManager.testLogin() and returns the result as JSON.
    server.tool('verify-login', 'Check current Microsoft authentication status', {}, async () => {
      let testResult: Awaited<ReturnType<AuthManager['testLogin']>>;
      try {
        testResult = await authManager.testLogin();
      } catch (error) {
        testResult = {
          success: false,
          message: `Login failed: ${(error as Error).message}`,
        };
      }
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(testResult),
          },
        ],
      };
    });
  • src/auth-tools.ts:5-5 (registration)
    The registerAuthTools function registers the 'verify-login' tool on the server via server.tool().
    export function registerAuthTools(server: McpServer, authManager: AuthManager): void {
  • The LoginTestResult interface defining the shape of the return value from testLogin().
    interface LoginTestResult {
      success: boolean;
      message: string;
      userData?: {
        displayName: string;
        userPrincipalName: string;
      };
    }
  • The testLogin() method on AuthManager that actually performs the login verification by getting a token and testing Graph API access.
    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 secrets = await getSecrets();
          const cloudEndpoints = getCloudEndpoints(secrets.cloudType);
          const response = await fetch(`${cloudEndpoints.graphApi}/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}`,
        };
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It only states the function without clarifying side effects, return values, or error conditions (e.g., whether it throws if not authenticated). This is insufficient for a safe tool invocation.

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, front-loaded sentence that immediately conveys the tool's purpose with no unnecessary words.

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?

Given no output schema, the description should specify what 'authentication status' means (e.g., boolean, user info). It lacks this detail, making it incomplete for an agent to interpret results correctly. However, the simplicity of the tool reduces the gap.

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 no parameters, so the description correctly adds no parameter details. Baseline for zero-parameter tools is 4, as the schema already fully describes the input.

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 uses a specific verb 'Check' and resource 'Microsoft authentication status', clearly indicating the tool's function. It effectively distinguishes itself from sibling tools like 'login' and 'logout'.

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

Usage Guidelines3/5

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

The description provides no explicit guidance on when to use this tool versus alternatives. While the purpose is clear, it does not state prerequisites or scenarios (e.g., 'use before other operations') to help an agent decide.

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/Softeria/ms-365-mcp-server'

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