zetrix_check_health
Check the operational status of the Zetrix blockchain node to verify system availability and functionality.
Instructions
Check the health status of the Zetrix node
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:61-68 (registration)Tool registration including name, description, and empty input schema (no parameters required). This is part of the tools array served via ListToolsRequestHandler.{ name: "zetrix_check_health", description: "Check the health status of the Zetrix node", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:777-787 (handler)MCP server request handler for CallToolRequest. Extracts no arguments (empty schema), calls ZetrixClient.checkHealth(), and returns JSON-formatted result as text content.case "zetrix_check_health": { const result = await zetrixClient.checkHealth(); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/zetrix-client.ts:163-183 (handler)Core implementation of the health check in ZetrixClient class. Performs GET /hello to the RPC endpoint, checks HTTP 200 status for health, includes network/RPC details and timestamp. Returns error details if failed.async checkHealth(): Promise<ZetrixNodeHealth> { try { const response = await this.client.get("/hello"); return { healthy: response.status === 200, network: this.network, rpcUrl: this.rpcUrl, timestamp: Date.now(), }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { healthy: false, network: this.network, rpcUrl: this.rpcUrl, timestamp: Date.now(), error: errorMessage, }; } }
- src/zetrix-client.ts:54-60 (schema)TypeScript interface defining the structure of the health check response.export interface ZetrixNodeHealth { healthy: boolean; network: string; rpcUrl: string; timestamp: number; error?: string; }