Skip to main content
Glama

health_check

Verify connectivity to the N Lobby school portal API to ensure reliable access to announcements, schedules, and learning resources.

Instructions

Check if N Lobby API connection is working

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler for the 'health_check' tool. It invokes the api.healthCheck() method and formats the response indicating whether the N Lobby API connection is healthy or failed.
    case "health_check": {
      const isHealthy = await this.api.healthCheck();
      return {
        content: [
          {
            type: "text",
            text: `N Lobby API connection: ${isHealthy ? "healthy" : "failed"}`,
          },
        ],
      };
    }
  • src/server.ts:336-343 (registration)
    Registration of the 'health_check' tool in the tools list provided to MCP server, including its name, description, and input schema (empty object).
    {
      name: "health_check",
      description: "Check if N Lobby API connection is working",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • Input schema for the health_check tool: an empty object (no parameters required).
    inputSchema: {
      type: "object",
      properties: {},
    },
  • The core healthCheck implementation in the TrpcClient class. It tests multiple tRPC methods (updateLastAccess, getUnreadNewsCount, findMainNavigations) sequentially and returns true if any succeeds, false otherwise.
    async healthCheck(): Promise<boolean> {
      logger.info("Running tRPC health check...");
    
      // Try multiple endpoints to verify connection
      const healthCheckMethods = [
        { name: "updateLastAccess", method: () => this.updateLastAccess() },
        { name: "getUnreadNewsCount", method: () => this.getUnreadNewsCount() },
        { name: "findMainNavigations", method: () => this.findMainNavigations() },
      ];
    
      for (const { name, method } of healthCheckMethods) {
        try {
          logger.debug(`Trying tRPC method: ${name}`);
          await method();
          logger.info(`[SUCCESS] tRPC health check passed with method: ${name}`);
          return true;
        } catch (error) {
          logger.debug(
            `[ERROR] tRPC method ${name} failed:`,
            error instanceof Error ? error.message : "Unknown error",
          );
          continue;
        }
      }
    
      logger.error("[ERROR] All tRPC health check methods failed");
      return 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/minagishl/nlobby-mcp'

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