get_health_status
Check system health and availability status to monitor operational reliability and service uptime.
Instructions
Get system health status and availability information.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/get-health-status.ts:10-37 (handler)Primary handler function that executes the tool logic: fetches health status from Langfuse client, formats as JSON text response or error message.export async function getHealthStatus( client: LangfuseAnalyticsClient, args: GetHealthStatusArgs ) { try { const healthData = await client.getHealthStatus(); return { content: [ { type: 'text' as const, text: JSON.stringify(healthData, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: 'text' as const, text: `Error getting health status: ${errorMessage}`, }, ], isError: true, }; } }
- src/tools/get-health-status.ts:4-8 (schema)Zod schema for input validation (empty parameters) and inferred TypeScript type.export const getHealthStatusSchema = z.object({ // No parameters needed for health check }); export type GetHealthStatusArgs = z.infer<typeof getHealthStatusSchema>;
- src/index.ts:540-547 (registration)Tool registration in the ListTools handler, defining name, description, and input schema.{ name: 'get_health_status', description: 'Get system health status and availability information.', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:1067-1070 (registration)Dispatch handler in CallToolRequestSchema switch that validates arguments and invokes the tool handler.case 'get_health_status': { const args = getHealthStatusSchema.parse(request.params.arguments); return await getHealthStatus(this.client, args); }
- src/langfuse-client.ts:276-286 (helper)LangfuseAnalyticsClient helper method that performs the HTTP GET request to the Langfuse /api/public/health endpoint.async getHealthStatus(): Promise<any> { const response = await fetch(`${this.config.baseUrl}/api/public/health`, { method: 'GET', }); if (!response.ok) { await this.handleApiError(response, 'Health Check'); } return await response.json(); }