whatsapp_set_account_picture
Update your WhatsApp profile picture by providing base64 encoded image data. This tool allows you to change your account's display image through the WSAPI WhatsApp service.
Instructions
Update account profile picture.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pictureBase64 | Yes | Base64 encoded image data |
Input Schema (JSON Schema)
{
"properties": {
"pictureBase64": {
"description": "Base64 encoded image data",
"type": "string"
}
},
"required": [
"pictureBase64"
],
"type": "object"
}
Implementation Reference
- src/tools/account.ts:43-48 (handler)The core handler function for the whatsapp_set_account_picture tool. It validates the input using setAccountPictureSchema, logs the action, makes a POST request to the WSAPI /account/picture endpoint with the base64 picture data, and returns a success response with the picture ID.handler: async (args: any) => { const input = validateInput(setAccountPictureSchema, args); logger.info('Setting account picture'); const result = await wsapiClient.post('/account/picture', input); return { success: true, pictureId: result.id, message: 'Account picture updated successfully' }; },
- src/validation/schemas.ts:264-266 (schema)Zod validation schema defining the input structure for the tool: an object containing pictureBase64 (base64 encoded image data). Used by validateInput in the handler.export const setAccountPictureSchema = z.object({ pictureBase64: base64Schema, });
- src/server.ts:57-65 (registration)The accountTools object (which includes whatsapp_set_account_picture) is added to the toolCategories array, which is then iterated to register all tools by name into the MCP server's tools Map.const toolCategories = [ messagingTools, contactTools, groupTools, chatTools, sessionTools, instanceTools, accountTools, ];
- src/server.ts:21-21 (registration)Import of the accountTools object containing the whatsapp_set_account_picture tool handler from src/tools/account.ts.import { accountTools } from './tools/account.js';
- src/tools/account.ts:85-85 (registration)Export of the accountTools bundle that groups the account-related tools, including setAccountPicture (whatsapp_set_account_picture), for registration in the server.export const accountTools = { getAccountInfo, setAccountName, setAccountPicture, setAccountPresence, setAccountStatus };