Skip to main content
Glama

waha_demote_group_admin

Remove admin privileges from participants in a WhatsApp group. Requires admin access to manage group permissions and maintain appropriate access levels.

Instructions

Remove admin privileges from participant(s). Requires admin privileges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYesGroup ID (format: number@g.us)
participantsYesJSON array of participants to demote (format: [{'id': 'number@c.us'}, ...])

Implementation Reference

  • MCP tool handler: parses input args (groupId and JSON participants), calls wahaClient.demoteGroupAdmin, returns formatted success response with result.
    private async handleDemoteGroupAdmin(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.demoteGroupAdmin({ groupId, participants, }); return { content: [ { type: "text", text: `Successfully demoted ${participants.length} admin(s) in group ${groupId}.\n${JSON.stringify(result, null, 2)}`, }, ], }; }
  • Tool schema: defines input parameters groupId (string) and participants (JSON string array of {id: string}), both required.
    name: "waha_demote_group_admin", description: "Remove admin privileges from participant(s). 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 demote (format: [{'id': 'number@c.us'}, ...])", }, }, required: ["groupId", "participants"], }, },
  • src/index.ts:1117-1118 (registration)
    Tool registration in CallToolRequestSchema dispatcher switch statement.
    case "waha_demote_group_admin": return await this.handleDemoteGroupAdmin(args);
  • WAHAClient helper method: performs HTTP POST to WAHA API endpoint /groups/{groupId}/admin/demote with participants array.
    async demoteGroupAdmin(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/demote`; const body = { participants }; return this.request<any>(endpoint, { method: "POST", body: JSON.stringify(body), }); }

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