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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/handlers.ts:330-388 (handler)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, }; } }
- src/tools/definitions/system.ts:5-15 (schema)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;
- src/tools/definitions.ts:27-33 (registration)Includes systemTools (which defines get_health) in the aggregated list of all tool definitions returned by buildToolDefinitions.return [ dynamicAskQuestionTool, ...notebookManagementTools, ...sessionManagementTools, ...systemTools, ]; }