whatsapp_update_instance_settings
Modify WhatsApp instance configuration including name, description, and event pull mode settings to customize how the WhatsApp session operates within the WSAPI service.
Instructions
Update instance settings.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Instance description | |
| name | No | Instance name | |
| pullMode | No | Enable pull mode for events |
Implementation Reference
- src/tools/instance.ts:19-36 (handler)The complete ToolHandler object implementing the 'whatsapp_update_instance_settings' tool, including inline inputSchema, description, and the handler function that performs input validation and calls the WSAPI to update instance settings.export const updateInstanceSettings: ToolHandler = { name: 'whatsapp_update_instance_settings', description: 'Update instance settings.', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Instance name', optional: true }, description: { type: 'string', description: 'Instance description', optional: true }, pullMode: { type: 'boolean', description: 'Enable pull mode for events', optional: true }, }, }, handler: async (args: any) => { const input = validateInput(updateInstanceSettingsSchema, args); logger.info('Updating instance settings'); const result = await wsapiClient.put('/instance/settings', input); return { success: true, settings: result, message: 'Instance settings updated successfully' }; }, };
- src/validation/schemas.ts:282-286 (schema)Zod schema (updateInstanceSettingsSchema) used within the tool handler for strict input validation before calling the WSAPI.export const updateInstanceSettingsSchema = z.object({ name: z.string().optional(), description: z.string().optional(), pullMode: z.boolean().optional(), });
- src/server.ts:57-65 (registration)Registration of instanceTools (which includes whatsapp_update_instance_settings) in the toolCategories array, which is iterated to register all tools into the MCP server's tools Map in setupToolHandlers().const toolCategories = [ messagingTools, contactTools, groupTools, chatTools, sessionTools, instanceTools, accountTools, ];
- src/tools/instance.ts:60-60 (registration)Export of instanceTools object grouping instance-related tools, imported and registered in src/server.ts.export const instanceTools = { getInstanceSettings, updateInstanceSettings, restartInstance, updateApiKey };
- src/tools/instance.ts:22-29 (schema)Inline inputSchema provided to the MCP SDK for tool listing and validation.inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Instance name', optional: true }, description: { type: 'string', description: 'Instance description', optional: true }, pullMode: { type: 'boolean', description: 'Enable pull mode for events', optional: true }, }, },