Skip to main content
Glama
wsapi-chat
by wsapi-chat

whatsapp_get_qr_code_image

Generate a QR code image to authenticate and log into WhatsApp through the WSAPI service for session management.

Instructions

Get QR code image for WhatsApp login.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler implementation for the 'whatsapp_get_qr_code_image' tool. It fetches the QR code image by calling the WSAPI endpoint '/session/login/qr/image' via wsapiClient and returns the result.
    export const getQRCodeImage: ToolHandler = { name: 'whatsapp_get_qr_code_image', description: 'Get QR code image for WhatsApp login.', inputSchema: { type: 'object', properties: {} }, handler: async () => { logger.info('Getting QR code image'); const result = await wsapiClient.get('/session/login/qr/image'); return { success: true, image: result, message: 'QR code image retrieved successfully' }; }, };
  • Helper object that bundles all session-related tool handlers, including 'whatsapp_get_qr_code_image', for convenient import and registration.
    export const sessionTools = { getSessionStatus, getQRCode, getQRCodeImage, getPairCode, logout };
  • src/server.ts:53-79 (registration)
    Registration logic in the MCP server that includes the sessionTools bundle (containing whatsapp_get_qr_code_image) in toolCategories and registers each tool handler into the server's tools 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`); }

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