Skip to main content
Glama

zetrix_ws_disconnect

Terminate active WebSocket connections to stop receiving real-time blockchain updates from the Zetrix network.

Instructions

Disconnect from WebSocket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool metadata and input schema definition for 'zetrix_ws_disconnect', registered in the tools list served via ListToolsRequestSchema.
    { name: "zetrix_ws_disconnect", description: "Disconnect from WebSocket", inputSchema: { type: "object", properties: {}, }, },
  • Primary MCP tool handler within CallToolRequestSchema switch statement. Retrieves the WebSocket client singleton and invokes its disconnect method, returning success message.
    case "zetrix_ws_disconnect": { const wsClient = getWebSocketClient(); wsClient.disconnect(); return { content: [ { type: "text", text: "WebSocket disconnected successfully", }, ], }; }
  • Core implementation of WebSocket disconnection in ZetrixWebSocketClient class. Closes the connection, nullifies the WebSocket instance, and resets registration state.
    disconnect() { if (this.ws) { this.ws.close(); this.ws = null; this.isRegistered = false; } }
  • Singleton factory helper for 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; }

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