Skip to main content
Glama

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
NameRequiredDescriptionDefault
groupIdYesGroup 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"], }, },
  • 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}`, }, ], };
  • 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);

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/seejux/waha-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server