send_websocket_action
Send action messages to WebSocket clients for real-time communication in application testing and development.
Instructions
Send an action message to connected WebSocket client
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | Session identifier | |
| action | Yes | Action name (e.g., logout, navigate) | |
| params | No | Optional action parameters |
Implementation Reference
- src/mcp/tools.ts:159-185 (handler)The handler implementation for the 'send_websocket_action' tool. It validates the input arguments and delegates to 'wsHub.sendAction'.
send_websocket_action: async (args: any) => { try { const { sessionId, action, params } = args; if (!sessionId || !action) { return { success: false, error: 'Missing required fields: sessionId, action' }; } const sent = wsHub.sendAction(sessionId, action, params); if (!sent) { return { success: false, error: 'No active connection for session' }; } return { success: true }; } catch (error: any) { return { success: false, error: `Failed to send action: ${error.message}` }; } - src/mcp/server.ts:143-163 (registration)Registration and input schema definition for the 'send_websocket_action' tool.
{ name: 'send_websocket_action', description: 'Send an action message to connected WebSocket client', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Session identifier', }, action: { type: 'string', description: 'Action name (e.g., logout, navigate)', }, params: { type: 'object', description: 'Optional action parameters', }, }, required: ['sessionId', 'action'], },