Skip to main content
Glama

get_health

Check server health status, authentication state, and active sessions to verify readiness for research workflows before starting.

Instructions

Get server health status including authentication state, active sessions, and configuration. Use this to verify the server is ready before starting research workflows.

If authenticated=false and having persistent issues: Consider running cleanup_data(preserve_library=true) + setup_auth for fresh start with clean browser session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the get_health tool: checks authentication via AuthManager, retrieves session stats from SessionManager, gathers config values, and returns health status object.
    async handleGetHealth(): Promise<
      ToolResult<{
        status: string;
        authenticated: boolean;
        notebook_url: string;
        active_sessions: number;
        max_sessions: number;
        session_timeout: number;
        total_messages: number;
        headless: boolean;
        auto_login_enabled: boolean;
        stealth_enabled: boolean;
        troubleshooting_tip?: string;
      }> 
    > {
      log.info(`🔧 [TOOL] get_health called`);
    
      try {
        // Check authentication status
        const statePath = await this.authManager.getValidStatePath();
        const authenticated = statePath !== null;
    
        // Get session stats
        const stats = this.sessionManager.getStats();
    
        const result = {
          status: "ok",
          authenticated,
          notebook_url: CONFIG.notebookUrl || "not configured",
          active_sessions: stats.active_sessions,
          max_sessions: stats.max_sessions,
          session_timeout: stats.session_timeout,
          total_messages: stats.total_messages,
          headless: CONFIG.headless,
          auto_login_enabled: CONFIG.autoLoginEnabled,
          stealth_enabled: CONFIG.stealthEnabled,
          // Add troubleshooting tip if not authenticated
          ...((!authenticated) && {
            troubleshooting_tip:
              "For fresh start with clean browser session: Close all Chrome instances → " +
              "cleanup_data(confirm=true, preserve_library=true) → setup_auth"
          }),
        };
    
        log.success(`✅ [TOOL] get_health completed`);
        return {
          success: true,
          data: result,
        };
      } catch (error) {
        const errorMessage =
          error instanceof Error ? error.message : String(error);
        log.error(`❌ [TOOL] get_health failed: ${errorMessage}`);
        return {
          success: false,
          error: errorMessage,
        };
      }
    }
  • Defines the MCP tool schema for get_health: name, detailed description, and empty input schema (no parameters required).
      name: "get_health",
      description:
        "Get server health status including authentication state, active sessions, and configuration. " +
        "Use this to verify the server is ready before starting research workflows.\n\n" +
        "If authenticated=false and having persistent issues:\n" +
        "Consider running cleanup_data(preserve_library=true) + setup_auth for fresh start with clean browser session.",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.ts:248-250 (registration)
    Registers the dispatching of get_health tool calls in the main MCP server request handler switch statement, routing to ToolHandlers.handleGetHealth().
    case "get_health":
      result = await this.toolHandlers.handleGetHealth();
      break;
  • Includes systemTools (which defines get_health) in the aggregated list of all tool definitions returned by buildToolDefinitions.
      return [
        dynamicAskQuestionTool,
        ...notebookManagementTools,
        ...sessionManagementTools,
        ...systemTools,
      ];
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior3/5

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

Because annotations are absent, the description carries the burden. 'Get' implies read-only behavior and the returned categories are named, but there is no explicit statement that the call has no side effects, no authentication requirements, or no impact on sessions. The recovery note adds some useful behavioral context, but not full transparency.

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 three compact, purposeful sentences: purpose, usage context, and an actionable troubleshooting fallback. It front-loads the core definition and every sentence earns its place.

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

Completeness4/5

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

The description tells an agent what to call, why, and what to inspect (authentication state, active sessions, configuration), plus how to recover from a failed health check. Since there is no output schema, a slightly more explicit return-shape note would make it fully complete, but the existing guidance is sufficient for a health check tool.

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 takes zero parameters and schema coverage is complete, so there are no undocumented parameters to clarify. The rubric baseline for zero-parameter tools is 4, and the description does not need to add parameter-level detail.

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 states a clear action ('Get server health status') and specifies the resource by enumerating what is included: authentication state, active sessions, and configuration. This makes the tool's function immediately identifiable and distinct from the other notebook/session tools.

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?

It explicitly says to use this tool to verify the server is ready before starting research workflows, which is a concrete usage context. It also gives a conditional recovery path (cleanup_data + setup_auth when authenticated=false with persistent issues), but it does not explicitly contrast the tool with siblings such as list_sessions or setup_auth.

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