node_health
Monitor and verify Arbitrum node health status using admin API access. Input RPC URL or chain name to assess node functionality and ensure optimal performance.
Instructions
Check Arbitrum node health status (requires admin API access - may not work with public RPCs)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainName | No | Chain name (e.g., 'Xai', 'Arbitrum One') - will auto-resolve to RPC URL | |
| rpcUrl | No | The RPC URL of the Arbitrum node (optional if default is set) |
Implementation Reference
- src/index.ts:154-168 (handler)The primary handler for the 'node_health' MCP tool. Resolves the RPC URL from provided arguments or chain lookup, instantiates NitroNodeClient, calls getHealth(), and returns the health status as JSON text content.case "node_health": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const nodeClient = new NitroNodeClient(rpcUrl); const health = await nodeClient.getHealth(); return { content: [ { type: "text", text: JSON.stringify(health, null, 2), }, ], }; }
- src/index.ts:854-874 (schema)The input schema and metadata definition for the 'node_health' tool, returned in listTools response.{ name: "node_health", description: "Check Arbitrum node health status (requires admin API access - may not work with public RPCs)", inputSchema: { type: "object" as const, properties: { rpcUrl: { type: "string", description: "The RPC URL of the Arbitrum node (optional if default is set)", }, chainName: { type: "string", description: "Chain name (e.g., 'Xai', 'Arbitrum One') - will auto-resolve to RPC URL", }, }, required: [], }, },
- Core helper function getHealth() in NitroNodeClient that makes the RPC call to 'arb_getHealth' and formats the NodeHealth response, with fallback error handling.async getHealth(): Promise<NodeHealth> { try { const response = await this.makeRpcCall("arb_getHealth", []); return { status: response.status || "unknown", lastUpdated: new Date().toISOString(), }; } catch (error) { return { status: "unavailable", lastUpdated: new Date().toISOString(), error: "Health check not supported on this RPC endpoint. This method typically requires access to a node's admin API.", }; } }
- src/clients/nitro-node-client.ts:3-7 (schema)TypeScript interface defining the NodeHealth response structure used by the node_health tool.export interface NodeHealth { status: string; lastUpdated: string; error?: string; }
- src/index.ts:93-102 (registration)Registration of the listTools request handler, which returns the list of tools including 'node_health' via getAvailableTools().this.server.setRequestHandler(ListToolsRequestSchema, async () => { try { console.error("Handling list tools request"); return { tools: this.getAvailableTools(), }; } catch (error) { console.error("Error in list tools handler:", error); throw error; }