send_websocket_data
Send data payloads to connected WebSocket clients in SpyNet mock servers for real-time communication during application testing and development.
Instructions
Send a data message to connected WebSocket client
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | Session identifier | |
| data | Yes | Data payload to send |
Implementation Reference
- src/mcp/tools.ts:188-215 (handler)Implementation of the send_websocket_data tool handler.
send_websocket_data: async (args: any) => { try { const { sessionId, data } = args; if (!sessionId || data === undefined) { return { success: false, error: 'Missing required fields: sessionId, data' }; } const sent = wsHub.sendData(sessionId, data); if (!sent) { return { success: false, error: 'No active connection for session' }; } return { success: true }; } catch (error: any) { return { success: false, error: `Failed to send data: ${error.message}` }; } } - src/mcp/server.ts:166-175 (registration)Registration and schema definition for the send_websocket_data tool.
name: 'send_websocket_data', description: 'Send a data message to connected WebSocket client', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Session identifier', }, data: {