Skip to main content
Glama

zetrix_ws_status

Check WebSocket connection status for real-time blockchain updates on the Zetrix network.

Instructions

Check WebSocket connection status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler implementation for the 'zetrix_ws_status' tool. Retrieves the WebSocket client instance and returns its connection status along with the WS URL.
    case "zetrix_ws_status": { const wsClient = getWebSocketClient(); const isConnected = wsClient.isConnected(); return { content: [ { type: "text", text: JSON.stringify({ connected: isConnected, wsUrl: ZETRIX_WS_URL || WS_NETWORK_URLS[ZETRIX_NETWORK], }, null, 2), }, ], }; }
  • Tool schema definition for 'zetrix_ws_status', including name, description, and empty input schema (no parameters required).
    { name: "zetrix_ws_status", description: "Check WebSocket connection status", inputSchema: { type: "object", properties: {}, }, },
  • Core helper method 'isConnected()' in ZetrixWebSocketClient class that checks if WebSocket is open and registered, providing the actual status logic used by the tool.
    isConnected(): boolean { return this.ws?.readyState === WebSocket.OPEN && this.isRegistered; }
  • Singleton factory function 'getWebSocketClient()' that lazily initializes and returns the shared ZetrixWebSocketClient instance used by the tool.
    function getWebSocketClient(): ZetrixWebSocketClient { if (!zetrixWsClient) { const wsUrl = ZETRIX_WS_URL || WS_NETWORK_URLS[ZETRIX_NETWORK]; zetrixWsClient = new ZetrixWebSocketClient(wsUrl); } return zetrixWsClient; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Zetrix-Chain/zetrix-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server