whatsapp_update_group_name
Change the name of a WhatsApp group by providing the group ID and new name, enabling group management through the WSAPI WhatsApp MCP Server.
Instructions
Update group name.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | Yes | Group ID (with @g.us) | |
| name | Yes | New group name |
Implementation Reference
- src/tools/groups.ts:53-69 (handler)The complete ToolHandler definition for 'whatsapp_update_group_name', including inputSchema for MCP and the handler function that performs input validation and API call to update the group name.export const updateGroupName: ToolHandler = { name: 'whatsapp_update_group_name', description: 'Update group name.', inputSchema: { type: 'object', properties: { groupId: { type: 'string', description: 'Group ID (with @g.us)' }, name: { type: 'string', description: 'New group name' }, }, required: ['groupId', 'name'], }, handler: async (args: any) => { const input = validateInput(updateGroupNameSchema, args); await wsapiClient.put(`/groups/${input.groupId}/name`, { name: input.name }); return { success: true, message: 'Group name updated successfully' }; }, };
- src/validation/schemas.ts:204-207 (schema)Zod schema used for internal validation of inputs in the whatsapp_update_group_name handler.export const updateGroupNameSchema = z.object({ groupId: groupIdSchema, name: z.string().min(1).max(255), });
- src/server.ts:57-65 (registration)Registration of groupTools (which includes whatsapp_update_group_name) in the toolCategories array, which is then looped over to register all tools in the MCP server.const toolCategories = [ messagingTools, contactTools, groupTools, chatTools, sessionTools, instanceTools, accountTools, ];
- src/server.ts:17-17 (registration)Import of groupTools containing the whatsapp_update_group_name tool.import { groupTools } from './tools/groups.js';