Update Group Subject
update_group_subjectChanges the name of a WhatsApp group using the instance's connection. Provide the group JID and new subject to update the group's display name.
Instructions
Update the name/subject of a WhatsApp group via the pinned instance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupJid | Yes | Group JID (e.g. 120363000000000000@g.us) | |
| subject | Yes | New group subject/name |
Implementation Reference
- src/tools/update-group-subject.ts:11-32 (handler)The registerUpdateGroupSubject function registers the 'update_group_subject' tool handler. It accepts groupJid and subject, sends a POST to /group/updateGroupSubject/{instanceName}?groupJid=..., and returns the API response.
export function registerUpdateGroupSubject(server: McpServer, client: EvolutionClient): void { server.registerTool( "update_group_subject", { title: "Update Group Subject", description: "Update the name/subject of a WhatsApp group via the pinned instance.", inputSchema: schema, }, async (args) => { try { const data = await client.post( `/group/updateGroupSubject/${client.instanceName}?groupJid=${encodeURIComponent(args.groupJid)}`, { subject: args.subject } ); 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; } } ); } - Input schema for the tool: groupJid (string) and subject (string), both required.
const schema = { groupJid: z.string().min(1).describe("Group JID (e.g. 120363000000000000@g.us)"), subject: z.string().min(1).describe("New group subject/name"), }; - src/tools/index.ts:118-118 (registration)Registration call: registerUpdateGroupSubject(server, client) invoked in the tools index.
registerUpdateGroupSubject(server, client); - src/tools/index.ts:45-45 (registration)Import of registerUpdateGroupSubject from './update-group-subject.js' in the tools index.
import { registerUpdateGroupSubject } from "./update-group-subject.js";