waha_revoke_group_invite_code
Revoke and regenerate WhatsApp group invite codes to control access. This tool requires admin privileges to manage group security by invalidating old links and creating new ones.
Instructions
Revoke current invite link and generate a new one. Requires admin privileges.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | Yes | Group ID (format: number@g.us) |
Implementation Reference
- src/index.ts:785-797 (registration)Registration of the 'waha_revoke_group_invite_code' tool in the ListTools response, including schema definition.name: "waha_revoke_group_invite_code", description: "Revoke current invite link and generate a new one. Requires admin privileges.", inputSchema: { type: "object", properties: { groupId: { type: "string", description: "Group ID (format: number@g.us)", }, }, required: ["groupId"], }, },
- src/index.ts:2285-2301 (handler)The main handler function for the 'waha_revoke_group_invite_code' MCP tool. Validates input, calls the WAHA client, and formats the response with the new invite code.private async handleRevokeGroupInviteCode(args: any) { const groupId = args.groupId; if (!groupId) { throw new Error("groupId is required"); } const result = await this.wahaClient.revokeGroupInviteCode(groupId); return { content: [ { type: "text", text: `Successfully revoked previous invite code for group ${groupId}.\nNew invite link:\n${result.inviteCode}`, }, ], };
- src/client/waha-client.ts:1109-1119 (handler)WAHAClient method that makes the HTTP POST request to revoke the group invite code and retrieve the new one.async revokeGroupInviteCode(groupId: string): Promise<{ inviteCode: string }> { if (!groupId) { throw new WAHAError("groupId is required"); } const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/invite-code/revoke`; return this.request<{ inviteCode: string }>(endpoint, { method: "POST", }); }
- src/index.ts:1122-1124 (registration)Tool dispatch/registration in the CallToolRequestSchema switch statement.return await this.handleRevokeGroupInviteCode(args); case "waha_join_group": return await this.handleJoinGroup(args);