waha_promote_group_admin
Promote participants to group administrator roles in WhatsApp groups using admin privileges. Specify group ID and participant list to grant administrative permissions.
Instructions
Promote participant(s) to group admin. Requires admin privileges.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | Yes | Group ID (format: number@g.us) | |
| participants | Yes | JSON array of participants to promote (format: [{'id': 'number@c.us'}, ...]) |
Implementation Reference
- src/index.ts:735-751 (registration)Tool schema and registration in the listTools response. Defines input schema requiring groupId and participants as JSON string.name: "waha_promote_group_admin", description: "Promote participant(s) to group admin. Requires admin privileges.", inputSchema: { type: "object", properties: { groupId: { type: "string", description: "Group ID (format: number@g.us)", }, participants: { type: "string", description: "JSON array of participants to promote (format: [{'id': 'number@c.us'}, ...])", }, }, required: ["groupId", "participants"], }, },
- src/index.ts:2199-2226 (handler)Main tool handler. Parses input arguments, validates, calls WAHA client promoteGroupAdmin method, and formats success response.private async handlePromoteGroupAdmin(args: any) { const groupId = args.groupId; const participantsStr = args.participants; if (!groupId) { throw new Error("groupId is required"); } if (!participantsStr) { throw new Error("participants is required"); } const participants = JSON.parse(participantsStr); const result = await this.wahaClient.promoteGroupAdmin({ groupId, participants, }); return { content: [ { type: "text", text: `Successfully promoted ${participants.length} participant(s) to admin in group ${groupId}.\n${JSON.stringify(result, null, 2)}`, }, ], }; }
- src/client/waha-client.ts:1037-1059 (helper)WAHA client helper method that makes the actual HTTP POST request to WAHA API to promote participants to group admins.async promoteGroupAdmin(params: { groupId: string; participants: Array<{ id: string }>; }): Promise<any> { const { groupId, participants } = params; if (!groupId) { throw new WAHAError("groupId is required"); } if (!participants || participants.length === 0) { throw new WAHAError("participants array is required"); } const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/admin/promote`; const body = { participants }; return this.request<any>(endpoint, { method: "POST", body: JSON.stringify(body), }); }