waha_update_group_subject
Change the name of a WhatsApp group by providing the group ID and new subject, enabling group management through the WAHA MCP Server.
Instructions
Change group name/subject.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | Yes | Group ID (format: number@g.us) | |
| subject | Yes | New group name |
Implementation Reference
- src/index.ts:2031-2056 (handler)Main handler function for waha_update_group_subject tool. Validates input, calls WAHAClient.updateGroupSubject, and returns success message.private async handleUpdateGroupSubject(args: any) { const groupId = args.groupId; const subject = args.subject; if (!groupId) { throw new Error("groupId is required"); } if (!subject) { throw new Error("subject is required"); } await this.wahaClient.updateGroupSubject({ groupId, subject, }); return { content: [ { type: "text", text: `Successfully updated group ${groupId} name to "${subject}".`, }, ], }; }
- src/index.ts:635-651 (schema)Tool schema definition including input validation for groupId and subject parameters.name: "waha_update_group_subject", description: "Change group name/subject.", inputSchema: { type: "object", properties: { groupId: { type: "string", description: "Group ID (format: number@g.us)", }, subject: { type: "string", description: "New group name", }, }, required: ["groupId", "subject"], }, },
- src/index.ts:1103-1106 (registration)Tool dispatch registration in the CallToolRequestSchema switch statement.case "waha_update_group_subject": return await this.handleUpdateGroupSubject(args); case "waha_update_group_description": return await this.handleUpdateGroupDescription(args);
- src/client/waha-client.ts:893-915 (helper)Underlying WAHAClient helper method that performs the HTTP PUT request to update the group subject via WAHA API.async updateGroupSubject(params: { groupId: string; subject: string; }): Promise<void> { const { groupId, subject } = params; if (!groupId) { throw new WAHAError("groupId is required"); } if (!subject) { throw new WAHAError("subject is required"); } const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/subject`; const body = { subject }; await this.request<void>(endpoint, { method: "PUT", body: JSON.stringify(body), }); }