Update Group Description
update_group_descriptionChange a WhatsApp group's description via the pinned instance. Specify the group JID and new description, or clear by sending an empty string.
Instructions
Update the description of a WhatsApp group via the pinned instance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupJid | Yes | Group JID (e.g. 120363000000000000@g.us) | |
| description | Yes | New group description (empty string to clear) |
Implementation Reference
- Input schema for update_group_description: defines groupJid (string) and description (string) parameters using Zod.
const schema = { groupJid: z.string().min(1).describe("Group JID (e.g. 120363000000000000@g.us)"), description: z.string().describe("New group description (empty string to clear)"), }; - Handler function that registers the 'update_group_description' tool. Takes args.groupJid and args.description, POSTs to /group/updateGroupDescription/{instance} endpoint, and returns the response as JSON text.
export function registerUpdateGroupDescription(server: McpServer, client: EvolutionClient): void { server.registerTool( "update_group_description", { title: "Update Group Description", description: "Update the description of a WhatsApp group via the pinned instance.", inputSchema: schema, }, async (args) => { try { const data = await client.post( `/group/updateGroupDescription/${client.instanceName}?groupJid=${encodeURIComponent(args.groupJid)}`, { description: args.description } ); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } catch (e) { if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] }; throw e; } } ); } - src/tools/index.ts:46-46 (registration)Import of registerUpdateGroupDescription from update-group-description module.
import { registerUpdateGroupDescription } from "./update-group-description.js"; - src/tools/index.ts:119-119 (registration)Calls registerUpdateGroupDescription(server, client) to register the tool during setup.
registerUpdateGroupDescription(server, client); - src/evolution-client.ts:24-26 (helper)The EvolutionClient.post() helper method used by the handler to make the HTTP POST request.
async post<T = unknown>(path: string, body: unknown): Promise<T> { return this.request<T>("POST", path, body); }