get_health
Check the operational status of the Browserless instance to verify connectivity and service availability for browser automation tasks.
Instructions
Get health status of Browserless instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:532-550 (handler)Main handler logic for the 'get_health' tool that invokes client.getHealth() and formats the response as MCP content.case 'get_health': { const result = await this.client!.getHealth(); if (result.success && result.data) { return { content: [ { type: 'text', text: `Health status: ${result.data.status}`, }, { type: 'text', text: JSON.stringify(result.data, null, 2), }, ], }; } else { throw new Error(result.error || 'Failed to get health status'); } }
- src/index.ts:243-250 (registration)Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema (empty).{ name: 'get_health', description: 'Get health status of Browserless instance', inputSchema: { type: 'object', properties: {}, }, },
- src/client.ts:275-286 (helper)Implementation of getHealth method in BrowserlessClient that performs the actual HTTP GET request to the Browserless /health endpoint.async getHealth(): Promise<BrowserlessResponse<HealthResponse>> { try { const response: AxiosResponse<HealthResponse> = await this.httpClient.get('/health'); return { success: true, data: response.data, }; } catch (error) { return this.handleError(error); } }
- src/types.ts:325-341 (schema)TypeScript interface defining the structure of the HealthResponse returned by the /health endpoint.export interface HealthResponse { status: 'healthy' | 'unhealthy'; uptime: number; memory: { used: number; total: number; percentage: number; }; cpu: { usage: number; percentage: number; }; sessions: { active: number; total: number; }; }