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

whatsapp_get_chat

Retrieve detailed information about a specific WhatsApp chat using its unique chat ID. This tool enables AI assistants to access chat data for messaging, contact management, and group operations through the WSAPI WhatsApp MCP Server.

Instructions

Get information about a specific chat.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatIdYesChat ID

Implementation Reference

  • The ToolHandler implementation for the 'whatsapp_get_chat' tool. Defines the tool's metadata, input schema (basic), and handler function that validates arguments using getChatSchema and fetches specific chat information from the WSAPI endpoint.
    export const getChat: ToolHandler = { name: 'whatsapp_get_chat', description: 'Get information about a specific chat.', inputSchema: { type: 'object', properties: { chatId: { type: 'string', description: 'Chat ID' } }, required: ['chatId'], }, handler: async (args: any) => { const input = validateInput(getChatSchema, args); const result = await wsapiClient.get(`/chats/${input.chatId}`); return { success: true, chat: result }; }, };
  • Zod validation schema for whatsapp_get_chat input, requiring a chatId (union of phone number or group ID patterns). Used in the handler's validateInput call.
    export const getChatSchema = z.object({ chatId: chatIdSchema, });
  • src/server.ts:57-76 (registration)
    Registration logic in server setup that includes chatTools (exported from chats.ts containing whatsapp_get_chat) in toolCategories and registers each tool by name into the server's tools Map for MCP handling.
    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}`); }); });

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