connect_instance
Connect a WhatsApp Business instance to enable messaging through Evolution API for sending notifications, managing contacts, and handling business communications.
Instructions
Connect a WhatsApp instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceName | Yes | Instance name to connect |
Implementation Reference
- src/index.ts:596-606 (handler)The main MCP tool handler function for 'connect_instance'. It extracts the instanceName from args, calls evolutionAPI.connectInstance, and returns the result as a formatted JSON text response.private async handleConnectInstance(args: any) { const result = await evolutionAPI.connectInstance(args.instanceName); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/index.ts:67-73 (schema)Input schema definition for the 'connect_instance' tool, specifying instanceName as required string.inputSchema: { type: 'object', properties: { instanceName: { type: 'string', description: 'Instance name to connect' } }, required: ['instanceName'] }
- src/index.ts:64-74 (registration)Tool registration in the tools array, including name, description, and input schema. Used by the MCP listTools handler.{ name: 'connect_instance', description: 'Connect a WhatsApp instance', inputSchema: { type: 'object', properties: { instanceName: { type: 'string', description: 'Instance name to connect' } }, required: ['instanceName'] } },
- src/index.ts:490-491 (registration)Dispatcher switch case that routes 'connect_instance' tool calls to the handleConnectInstance method.case 'connect_instance': return await this.handleConnectInstance(args);
- src/services/evolution-api.ts:44-47 (helper)Helper method in EvolutionAPI service that makes the HTTP GET request to connect the WhatsApp instance via the Evolution API backend.async connectInstance(instanceName: string): Promise<Instance> { const response = await this.client.get(`/instance/connect/${instanceName}`); return response.data; }