getWebSocketStatus
Check WebSocket connection status for real-time cryptocurrency trading data on Bitget exchange. Monitor connectivity to ensure continuous market updates and order execution.
Instructions
Get WebSocket connection status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:544-557 (handler)The main handler for the getWebSocketStatus tool. It calls helper methods on the WebSocket client to get connection status and subscription count, then returns them as JSON.case 'getWebSocketStatus': { const status = { connected: this.wsClient.isWebSocketConnected(), subscriptions: this.wsClient.getSubscriptionCount(), }; return { content: [ { type: 'text', text: JSON.stringify(status, null, 2), }, ], } as CallToolResult; }
- src/server.ts:294-302 (registration)Registration of the getWebSocketStatus tool in the listTools handler, including name, description, and empty input schema.{ name: 'getWebSocketStatus', description: 'Get WebSocket connection status', inputSchema: { type: 'object', properties: {}, required: [] }, },
- src/api/websocket-client.ts:292-294 (helper)Helper method that returns the current WebSocket connection status (boolean). Used by the tool handler.isWebSocketConnected(): boolean { return this.isConnected; }
- src/api/websocket-client.ts:299-301 (helper)Helper method that returns the number of active WebSocket subscriptions. Used by the tool handler.getSubscriptionCount(): number { return this.subscriptions.size; }
- src/server.ts:297-302 (schema)Input schema for getWebSocketStatus tool (no parameters required). Defined inline in registration.inputSchema: { type: 'object', properties: {}, required: [] }, },