Skip to main content
Glama
by wsapi-chat

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

NameRequiredDescriptionDefault
pictureBase64YesBase64 encoded image data

Input Schema (JSON Schema)

{ "properties": { "pictureBase64": { "description": "Base64 encoded image data", "type": "string" } }, "required": [ "pictureBase64" ], "type": "object" }

Implementation Reference

  • 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' }; },
  • 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';
  • 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 };

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