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'],
      },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full disclosure burden but offers minimal behavioral context. It does not specify failure modes (e.g., client disconnected), whether the operation is synchronous, timeout behavior, or side effects beyond the basic sending action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The single sentence is efficiently structured and front-loaded with the operative verb. While extremely terse, it contains no redundant or wasted phrases. However, the brevity contributes to under-specification given the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given three parameters (including a nested object), no annotations, and no output schema, the description is insufficiently complete. Critical missing information includes: differentiation from 'send_websocket_data', error handling behavior, and the specific semantics of 'action' types (only partially covered by schema examples).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, establishing a baseline of 3. The description adds marginal value by contextualizing the 'action' parameter as an 'action message' and implying the 'sessionId' relates to a 'connected WebSocket client', though it does not elaborate on syntax or validation rules beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Send') and resource ('action message' to 'WebSocket client'), clearly stating the core operation. However, it fails to distinguish from the sibling tool 'send_websocket_data', leaving ambiguity about when to use 'action' versus 'data' messages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives (particularly 'send_websocket_data'), nor are prerequisites mentioned (e.g., requiring an active session/connection). Agents must infer usage solely from parameter names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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