create_group
Create WhatsApp groups for business communication by specifying participants, group name, and optional description using the Evolution API.
Instructions
Create a new WhatsApp group
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Group description | |
| instanceName | Yes | Instance name | |
| participants | Yes | Phone numbers of participants | |
| subject | Yes | Group name |
Implementation Reference
- src/index.ts:882-896 (handler)The main handler function for the 'create_group' MCP tool. It extracts arguments, calls the EvolutionAPI service to create the group, and returns the result as formatted text content.private async handleCreateGroup(args: any) { const result = await evolutionAPI.createGroup(args.instanceName, { subject: args.subject, participants: args.participants, description: args.description }); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/index.ts:339-352 (schema)Input schema defining the parameters for the 'create_group' tool: instanceName, subject, participants (required), and optional description.inputSchema: { type: 'object', properties: { instanceName: { type: 'string', description: 'Instance name' }, subject: { type: 'string', description: 'Group name' }, participants: { type: 'array', items: { type: 'string' }, description: 'Phone numbers of participants' }, description: { type: 'string', description: 'Group description' } }, required: ['instanceName', 'subject', 'participants'] }
- src/index.ts:337-353 (registration)Registration of the 'create_group' tool in the MCP tools array, used for listing available tools.name: 'create_group', description: 'Create a new WhatsApp group', inputSchema: { type: 'object', properties: { instanceName: { type: 'string', description: 'Instance name' }, subject: { type: 'string', description: 'Group name' }, participants: { type: 'array', items: { type: 'string' }, description: 'Phone numbers of participants' }, description: { type: 'string', description: 'Group description' } }, required: ['instanceName', 'subject', 'participants'] } },
- Helper function in EvolutionAPI class that performs the actual HTTP POST request to the Evolution API endpoint /group/create/{instanceName} to create the group.async createGroup(instanceName: string, data: { subject: string; participants: string[]; description?: string; }): Promise<Group> { const response = await this.client.post(`/group/create/${instanceName}`, data); return response.data; }