waha_unblock_contact
Remove a contact from your WhatsApp block list using their contact ID to restore communication.
Instructions
Unblock a contact.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contactId | Yes | Contact ID to unblock (format: number@c.us) |
Implementation Reference
- src/index.ts:2564-2581 (handler)The main handler function for the 'waha_unblock_contact' tool. Extracts contactId from arguments, validates it, calls the WAHA client's unblockContact method, and returns a formatted success response.private async handleUnblockContact(args: any) { const contactId = args.contactId; if (!contactId) { throw new Error("contactId is required"); } await this.wahaClient.unblockContact(contactId); return { content: [ { type: "text", text: `Successfully unblocked contact ${contactId}.`, }, ], }; }
- src/index.ts:973-985 (schema)The input schema and metadata definition for the 'waha_unblock_contact' tool, specifying the required 'contactId' parameter.name: "waha_unblock_contact", description: "Unblock a contact.", inputSchema: { type: "object", properties: { contactId: { type: "string", description: "Contact ID to unblock (format: number@c.us)", }, }, required: ["contactId"], }, },
- src/index.ts:1148-1149 (registration)Tool call registration in the MCP CallToolRequestSchema handler's switch statement, routing calls to the handleUnblockContact method.return await this.handleUnblockContact(args); case "waha_get_presence":
- src/client/waha-client.ts:1373-1387 (helper)The WAHAClient helper method that sends a POST request to /api/contacts/unblock to perform the unblock operation.async unblockContact(contactId: string): Promise<void> { if (!contactId) { throw new WAHAError("contactId is required"); } const body = { contactId, session: this.session, }; await this.request<void>("/api/contacts/unblock", { method: "POST", body: JSON.stringify(body), }); }