Skip to main content
Glama
by wsapi-chat

whatsapp_get_contact_business

Retrieve business profile details for a WhatsApp contact using their phone number, enabling access to company information, description, and business attributes.

Instructions

Get the business profile information of a WhatsApp contact.

Input Schema

NameRequiredDescriptionDefault
contactIdYesContact ID (phone number with @s.whatsapp.net)

Input Schema (JSON Schema)

{ "properties": { "contactId": { "description": "Contact ID (phone number with @s.whatsapp.net)", "type": "string" } }, "required": [ "contactId" ], "type": "object" }

Implementation Reference

  • The main ToolHandler implementation for 'whatsapp_get_contact_business'. Defines the tool name, description, inputSchema, and handler function that validates input using getContactSchema and fetches business profile via wsapiClient.
    export const getContactBusinessProfile: ToolHandler = { name: 'whatsapp_get_contact_business', description: 'Get the business profile information of a WhatsApp contact.', inputSchema: { type: 'object', properties: { contactId: { type: 'string', description: 'Contact ID (phone number with @s.whatsapp.net)', }, }, required: ['contactId'], }, handler: async (args: any) => { const input = validateInput(getContactSchema, args); logger.info('Getting contact business profile', { contactId: input.contactId }); const result = await wsapiClient.get(`/contacts/${input.contactId}/business`); logger.info('Retrieved contact business profile successfully', { contactId: input.contactId }); return { success: true, businessProfile: result, message: 'Contact business profile retrieved successfully', }; }, };
  • Zod schema used for input validation in the whatsapp_get_contact_business handler. Defines contactId as a phone number matching the WhatsApp format.
    export const getContactSchema = z.object({ contactId: phoneNumberSchema, });
  • src/server.ts:53-79 (registration)
    Registers the tool by including contactTools (which exports getContactBusinessProfile) in toolCategories and adding all tools to the server's tools Map for MCP handling.
    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