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

  • src/index.ts:412-419 (registration)
    Tool registration including name, description, and input schema (empty object). This is part of the tools array provided to ListToolsRequestHandler.
    { name: "zetrix_ws_status", description: "Check WebSocket connection status", inputSchema: { type: "object", properties: {}, }, },
  • The main handler for the 'zetrix_ws_status' tool. It retrieves the ZetrixWebSocketClient instance via getWebSocketClient(), checks if it is connected using isConnected(), and returns the status along with the WebSocket 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), }, ], }; }
  • Helper function that lazily initializes and returns the singleton ZetrixWebSocketClient instance used by the tool handler.
    function getWebSocketClient(): ZetrixWebSocketClient { if (!zetrixWsClient) { const wsUrl = ZETRIX_WS_URL || WS_NETWORK_URLS[ZETRIX_NETWORK]; zetrixWsClient = new ZetrixWebSocketClient(wsUrl); } return zetrixWsClient; }
  • Constant mapping WebSocket URLs for different Zetrix networks, used by getWebSocketClient().
    const WS_NETWORK_URLS: Record<ZetrixNetwork, string> = { mainnet: "ws://node-ws.zetrix.com", testnet: "ws://test-node-ws.zetrix.com", };

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