Skip to main content
Glama

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
NameRequiredDescriptionDefault
sessionIdYesSession identifier
actionYesAction name (e.g., logout, navigate)
paramsNoOptional action parameters

Implementation Reference

  • 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}`
        };
      }
  • 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'],
      },

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/aj-bartocci/SpyNet'

If you have feedback or need assistance with the MCP directory API, please join our Discord server