Restart Instance
restart_instanceRestart a pinned WhatsApp instance to reconnect without logging out.
Instructions
Restart the pinned WhatsApp instance (reconnects without logging out).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "restart_instance"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/restart-instance.ts:5-22 (handler)The full handler implementation for the 'restart_instance' tool. Registers the tool with no input schema, and on invocation calls POST /instance/restart/{instanceName} via the EvolutionClient.
export function registerRestartInstance(server: McpServer, client: EvolutionClient): void { server.registerTool( "restart_instance", { title: "Restart Instance", description: "Restart the pinned WhatsApp instance (reconnects without logging out).", inputSchema: {}, }, async () => { try { const data = await client.post(`/instance/restart/${client.instanceName}`, {}); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } catch (e) { if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] }; throw e; } } ); - src/tools/index.ts:132-132 (registration)Registration call that wires up the restart_instance tool to the MCP server and Evolution client.
registerRestartInstance(server, client); - src/tools/index.ts:59-59 (registration)Import of the registerRestartInstance function from the restart-instance module.
import { registerRestartInstance } from "./restart-instance.js"; - src/evolution-client.ts:16-18 (helper)The getter 'instanceName' on EvolutionClient used in the restart handler to build the API path.
get instanceName(): string { return this.instance; } - src/evolution-client.ts:24-26 (helper)The 'post' method on EvolutionClient used by the restart_instance handler to call the Evolution API.
async post<T = unknown>(path: string, body: unknown): Promise<T> { return this.request<T>("POST", path, body); }