waha_set_group_info_admin_only
Control group information editing permissions by toggling between admin-only and member access settings for WhatsApp groups.
Instructions
Toggle whether only admins can edit group info. Requires admin privileges.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | Yes | Group ID (format: number@g.us) | |
| adminsOnly | Yes | True = only admins can edit, false = all members can edit |
Implementation Reference
- src/index.ts:2381-2406 (handler)MCP tool handler: validates parameters, calls the WAHA client method, returns formatted success message.private async handleSetGroupInfoAdminOnly(args: any) { const groupId = args.groupId; const adminsOnly = args.adminsOnly; if (!groupId) { throw new Error("groupId is required"); } if (adminsOnly === undefined) { throw new Error("adminsOnly is required"); } await this.wahaClient.setGroupInfoAdminOnly({ groupId, adminsOnly, }); return { content: [ { type: "text", text: `Successfully set group ${groupId} info editing to ${adminsOnly ? 'admins only' : 'all members'}.`, }, ], }; }
- src/index.ts:844-860 (schema)Input schema definition for the tool, specifying required groupId (string) and adminsOnly (boolean). Provided in the list of tools response.{ name: "waha_set_group_info_admin_only", description: "Toggle whether only admins can edit group info. Requires admin privileges.", inputSchema: { type: "object", properties: { groupId: { type: "string", description: "Group ID (format: number@g.us)", }, adminsOnly: { type: "boolean", description: "True = only admins can edit, false = all members can edit", }, }, required: ["groupId", "adminsOnly"], },
- src/index.ts:1128-1130 (registration)Tool dispatch/registration in the CallToolRequestSchema switch statement, routing calls to the handler.return await this.handleSetGroupMessagesAdminOnly(args); case "waha_set_group_info_admin_only": return await this.handleSetGroupInfoAdminOnly(args);
- src/client/waha-client.ts:1188-1210 (helper)Underlying WAHA client method that performs the actual API PUT request to toggle group info admin-only setting.async setGroupInfoAdminOnly(params: { groupId: string; adminsOnly: boolean; }): Promise<void> { const { groupId, adminsOnly } = params; if (!groupId) { throw new WAHAError("groupId is required"); } if (adminsOnly === undefined) { throw new WAHAError("adminsOnly is required"); } const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/settings/security/info-admin-only`; const body = { adminsOnly }; await this.request<void>(endpoint, { method: "PUT", body: JSON.stringify(body), }); }