Skip to main content
Glama

waha_get_group_invite_code

Retrieve WhatsApp group invite codes to share access with participants. Provide the group ID to generate a reusable invitation link for group management.

Instructions

Get group invite link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYesGroup ID (format: number@g.us)

Implementation Reference

  • Main MCP tool handler that validates input, calls the WAHA client, and formats the response with the invite code.
    private async handleGetGroupInviteCode(args: any) { const groupId = args.groupId; if (!groupId) { throw new Error("groupId is required"); } const result = await this.wahaClient.getGroupInviteCode(groupId); return { content: [ { type: "text", text: `Group ${groupId} invite link:\n${result.inviteCode}`, }, ], }; }
  • WAHA API client method that performs the HTTP GET request to retrieve the group invite code.
    async getGroupInviteCode(groupId: string): Promise<{ inviteCode: string }> { if (!groupId) { throw new WAHAError("groupId is required"); } const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/invite-code`; return this.request<{ inviteCode: string }>(endpoint, { method: "GET", }); }
  • Tool schema definition including name, description, and input schema requiring groupId.
    name: "waha_get_group_invite_code", description: "Get group invite link.", inputSchema: { type: "object", properties: { groupId: { type: "string", description: "Group ID (format: number@g.us)", }, }, required: ["groupId"], },
  • src/index.ts:1119-1120 (registration)
    Tool registration in the MCP CallToolRequestSchema switch statement dispatching to the handler.
    case "waha_get_group_invite_code": return await this.handleGetGroupInviteCode(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