whatsapp_set_account_presence
Update your WhatsApp account status to show as available or unavailable to other users, controlling your online presence visibility.
Instructions
Set account presence status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes | Presence status |
Input Schema (JSON Schema)
{
"properties": {
"status": {
"description": "Presence status",
"enum": [
"available",
"unavailable"
],
"type": "string"
}
},
"required": [
"status"
],
"type": "object"
}
Implementation Reference
- src/tools/account.ts:51-67 (handler)The ToolHandler object defining the whatsapp_set_account_presence tool, including its name, description, input schema (inline), and handler function that validates input and sends PUT request to /account/presence via wsapiClient.export const setAccountPresence: ToolHandler = { name: 'whatsapp_set_account_presence', description: 'Set account presence status.', inputSchema: { type: 'object', properties: { status: { type: 'string', enum: ['available', 'unavailable'], description: 'Presence status' }, }, required: ['status'], }, handler: async (args: any) => { const input = validateInput(setAccountPresenceSchema, args); logger.info('Setting account presence'); await wsapiClient.put('/account/presence', input); return { success: true, message: 'Account presence updated successfully' }; }, };
- src/validation/schemas.ts:268-270 (schema)Zod schema used for validating the input parameters (status enum) in the whatsapp_set_account_presence handler.export const setAccountPresenceSchema = z.object({ status: z.enum(['available', 'unavailable']), });
- src/server.ts:57-65 (registration)Registration block in MCP server setup where accountTools (exporting whatsapp_set_account_presence) is included in toolCategories array, which is then iterated to register all tools in the server's tools Map.const toolCategories = [ messagingTools, contactTools, groupTools, chatTools, sessionTools, instanceTools, accountTools, ];