whatsapp_restart_instance
Restart the WhatsApp instance to resolve connection issues, refresh session status, or clear temporary glitches without losing chat history or account data.
Instructions
Restart the WhatsApp instance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/instance.ts:38-47 (handler)The ToolHandler object defining the 'whatsapp_restart_instance' tool. Includes the name, description, empty input schema, and async handler function that logs the action and sends a PUT request to '/instance/restart' via wsapiClient.export const restartInstance: ToolHandler = { name: 'whatsapp_restart_instance', description: 'Restart the WhatsApp instance.', inputSchema: { type: 'object', properties: {} }, handler: async () => { logger.info('Restarting instance'); await wsapiClient.put('/instance/restart', {}); return { success: true, message: 'Instance restarted successfully' }; }, };
- src/server.ts:67-75 (registration)The registration loop in setupToolHandlers() that iterates over toolCategories (which includes instanceTools containing the whatsapp_restart_instance handler) and registers each tool in the server's tools Map by name.toolCategories.forEach(category => { Object.values(category).forEach(tool => { if (this.tools.has(tool.name)) { logger.warn(`Tool ${tool.name} already registered, skipping`); return; } this.tools.set(tool.name, tool); logger.debug(`Registered tool: ${tool.name}`); });
- src/server.ts:57-65 (registration)The toolCategories array includes instanceTools (exported from src/tools/instance.ts), which bundles the whatsapp_restart_instance handler for registration.const toolCategories = [ messagingTools, contactTools, groupTools, chatTools, sessionTools, instanceTools, accountTools, ];
- src/tools/instance.ts:60-60 (registration)Exports the instanceTools object grouping instance-related tools including restartInstance (whatsapp_restart_instance) for server registration.export const instanceTools = { getInstanceSettings, updateInstanceSettings, restartInstance, updateApiKey };