Skip to main content
Glama

interactive_login

Open browser for manual login to access N Lobby school portal data including announcements, schedules, and learning resources through browser-based authentication.

Instructions

Open browser for manual login to N Lobby (no credentials required)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'interactive_login': initializes browser, performs interactive login via browserAuth, sets cookies, and returns success/error response
    case "interactive_login":
      try {
        // Initialize browser
        await this.browserAuth.initializeBrowser();
    
        // Start interactive login
        const extractedCookies =
          await this.browserAuth.interactiveLogin();
    
        // Set cookies in API client
        this.api.setCookies(extractedCookies.allCookies);
    
        // Close browser
        await this.browserAuth.close();
    
        return {
          content: [
            {
              type: "text",
              text: `[SUCCESS] Successfully logged in to N Lobby!\n\nExtracted cookies:\n- Session Token: ${extractedCookies.sessionToken ? "present" : "missing"}\n- CSRF Token: ${extractedCookies.csrfToken ? "present" : "missing"}\n- Callback URL: ${extractedCookies.callbackUrl || "not set"}\n\nYou can now access real N Lobby data using other tools.`,
            },
          ],
        };
      } catch (error) {
        // Ensure browser is closed on error
        await this.browserAuth.close();
    
        return {
          content: [
            {
              type: "text",
              text: `[ERROR] Interactive login failed: ${error instanceof Error ? error.message : "Unknown error"}\n\nPlease try again or contact support if the issue persists.`,
            },
          ],
        };
      }
  • Input schema for interactive_login tool (empty object, no parameters required)
    inputSchema: {
      type: "object",
      properties: {},
    },
  • src/server.ts:409-417 (registration)
    Registration of the 'interactive_login' tool in the MCP tools list
    {
      name: "interactive_login",
      description:
        "Open browser for manual login to N Lobby (no credentials required)",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • Core helper function implementing interactive browser-based login, navigating to N Lobby, waiting for user login, and extracting cookies
    async interactiveLogin(): Promise<ExtractedCookies> {
      // Check browser health before starting
      const isHealthy = await this.checkBrowserHealth();
      if (!isHealthy) {
        logger.warn("Browser unhealthy, reinitializing...");
        await this.initializeBrowser();
      }
    
      if (!this.browser || !this.page) {
        throw new Error(
          "Browser not initialized. Call initializeBrowser() first.",
        );
      }
    
      try {
        logger.info("Starting interactive login process...");
    
        // Navigate to N Lobby
        await this.page.goto(CONFIG.nlobby.baseUrl, {
          waitUntil: "networkidle2",
          timeout: 30000,
        });
    
        logger.info(
          "N Lobby page loaded. Please complete the login process in the browser window.",
        );
        logger.info("The browser will remain open for you to login manually.");
    
        // Wait for user to complete login (detect when we're on the authenticated page)
        await this.waitForLoginCompletionWithRetry(300000);
    
        logger.info("Login detected! Extracting cookies...");
    
        // Extract cookies after successful login
        const cookies = await this.extractCookies();
    
        return cookies;
      } catch (error) {
        logger.error("Interactive login failed:", error);
    
        // Enhanced error logging for interactive login
        if (this.page) {
          try {
            const currentUrl = await this.page.url();
            const title = await this.page.title();
            logger.error(`Current URL: ${currentUrl}`);
            logger.error(`Page title: ${title}`);
    
            // Take screenshot for debugging
            await this.takeScreenshot("interactive-login-failure-debug.png");
          } catch (debugError) {
            logger.error("Failed to capture debug information:", debugError);
          }
        }
    
        throw new Error(
          `Interactive login failed: ${error instanceof Error ? error.message : "Unknown error"}`,
        );
      }
    }
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 describes the action ('Open browser') and constraint ('no credentials required'), but lacks details on what happens after browser opening (e.g., user interaction required, timeout behavior, or success/failure indicators). It doesn't mention side effects like browser pop-ups or session implications.

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, efficient sentence that front-loads the core action ('Open browser for manual login') and includes essential context ('to N Lobby', 'no credentials required'). There is zero wasted verbiage, and every word contributes to understanding the tool's function.

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 annotations and no output schema, the description provides basic purpose but lacks completeness for an interactive authentication tool. It doesn't explain what the tool returns (e.g., success status, session tokens), user interaction requirements, or error handling. For a tool that likely involves external browser processes, more behavioral context would be helpful.

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 appropriately doesn't discuss parameters, maintaining focus on the tool's purpose. A baseline of 4 is applied since no parameters exist, and the description doesn't introduce unnecessary parameter information.

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 specific action ('Open browser for manual login') and target resource ('N Lobby'), distinguishing it from sibling tools like 'check_cookies' or 'verify_authentication' which handle authentication differently. It explicitly mentions 'no credentials required', which further clarifies its unique purpose.

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 implies usage context by specifying 'manual login' and 'no credentials required', suggesting this tool is for initiating authentication when credentials aren't provided programmatically. However, it doesn't explicitly state when to use this versus alternatives like 'set_cookies' or 'verify_authentication', or mention any prerequisites or exclusions.

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/minagishl/nlobby-cli'

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