Skip to main content
Glama
wsapi-chat

WSAPI WhatsApp MCP Server

by wsapi-chat

whatsapp_get_session_status

Check WhatsApp session status to verify connectivity and readiness for messaging operations.

Instructions

Get current WhatsApp session status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main tool handler for 'whatsapp_get_session_status'. It fetches the session status from the WSAPI client and returns it with success status.
    export const getSessionStatus: ToolHandler = {
      name: 'whatsapp_get_session_status',
      description: 'Get current WhatsApp session status.',
      inputSchema: { type: 'object', properties: {} },
      handler: async () => {
        logger.info('Getting session status');
        const result = await wsapiClient.get('/session/status');
        return { success: true, status: result, message: 'Session status retrieved successfully' };
      },
    };
  • src/server.ts:53-79 (registration)
    Registers the sessionTools object (containing whatsapp_get_session_status) along with other tools into the MCP server's tool registry map.
    private setupToolHandlers(): void {
      logger.info('Setting up tool handlers');
    
      // Register all tool categories
      const toolCategories = [
        messagingTools,
        contactTools,
        groupTools,
        chatTools,
        sessionTools,
        instanceTools,
        accountTools,
      ];
    
      toolCategories.forEach(category => {
        Object.values(category).forEach(tool => {
          if (this.tools.has(tool.name)) {
            logger.warn(`Tool ${tool.name} already registered, skipping`);
            return;
          }
          this.tools.set(tool.name, tool);
          logger.debug(`Registered tool: ${tool.name}`);
        });
      });
    
      logger.info(`Registered ${this.tools.size} tools`);
    }
  • Input schema for the tool, which expects no parameters (empty object).
    inputSchema: { type: 'object', properties: {} },

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/wsapi-chat/wsapi-mcp'

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