getWebSocketStatus
Check the real-time WebSocket connection status for the MCP Bitget Trading Server, ensuring reliable communication with Bitget exchange’s market data and trading operations.
Instructions
Get WebSocket connection status
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/server.ts:544-557 (handler)Handler for the getWebSocketStatus tool. Retrieves the WebSocket connection status and number of active subscriptions from the BitgetWebSocketClient and 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 MCP server's listTools response, including its description and input schema (no parameters required).{ name: 'getWebSocketStatus', description: 'Get WebSocket connection status', inputSchema: { type: 'object', properties: {}, required: [] }, },
- src/api/websocket-client.ts:292-294 (helper)Helper method in BitgetWebSocketClient that checks and returns the current WebSocket connection status.isWebSocketConnected(): boolean { return this.isConnected; }
- src/api/websocket-client.ts:299-301 (helper)Helper method in BitgetWebSocketClient that returns the number of active subscriptions.getSubscriptionCount(): number { return this.subscriptions.size; }