Skip to main content
Glama
by wsapi-chat

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

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • 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, ];
  • Exports the instanceTools object grouping instance-related tools including restartInstance (whatsapp_restart_instance) for server registration.
    export const instanceTools = { getInstanceSettings, updateInstanceSettings, restartInstance, updateApiKey };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wsapi-chat/wsapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server