delete_instance
Remove a WhatsApp Business instance to manage messaging resources and maintain clean API environments.
Instructions
Delete a WhatsApp instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceName | Yes | Instance name to delete |
Implementation Reference
- src/index.ts:620-630 (handler)The main MCP tool handler for 'delete_instance'. Extracts instanceName from input arguments, delegates to evolutionAPI.deleteInstance, and returns the result as MCP-formatted text content (JSON string).private async handleDeleteInstance(args: any) { const result = await evolutionAPI.deleteInstance(args.instanceName); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/index.ts:86-96 (registration)Tool registration definition in the global tools array. Includes name, description, and input schema. This array is provided to the MCP ListToolsRequestHandler.{ name: 'delete_instance', description: 'Delete a WhatsApp instance', inputSchema: { type: 'object', properties: { instanceName: { type: 'string', description: 'Instance name to delete' } }, required: ['instanceName'] } },
- src/index.ts:89-95 (schema)JSON schema for input validation: requires 'instanceName' string.inputSchema: { type: 'object', properties: { instanceName: { type: 'string', description: 'Instance name to delete' } }, required: ['instanceName'] }
- src/services/evolution-api.ts:54-57 (helper)Helper method in EvolutionAPI class that makes the HTTP DELETE request to the backend Evolution API endpoint `/instance/delete/{instanceName}` and returns the response.async deleteInstance(instanceName: string): Promise<{ status: string }> { const response = await this.client.delete(`/instance/delete/${instanceName}`); return response.data; }