whatsapp_set_account_name
Update your WhatsApp account display name to personalize your profile and maintain current identification across all chats and contacts.
Instructions
Update account display name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | New account name (max 255 characters) |
Input Schema (JSON Schema)
{
"properties": {
"name": {
"description": "New account name (max 255 characters)",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/tools/account.ts:19-33 (handler)The complete ToolHandler definition for 'whatsapp_set_account_name', including description, inline input schema, and the handler function that validates input using Zod schema and updates the account name via WSAPI.export const setAccountName: ToolHandler = { name: 'whatsapp_set_account_name', description: 'Update account display name.', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'New account name (max 255 characters)' } }, required: ['name'], }, handler: async (args: any) => { const input = validateInput(setAccountNameSchema, args); logger.info('Setting account name'); await wsapiClient.put('/account/name', input); return { success: true, message: 'Account name updated successfully' }; }, };
- src/validation/schemas.ts:260-262 (schema)Zod schema for validating the input to the whatsapp_set_account_name tool, enforcing name as string between 1-255 characters.export const setAccountNameSchema = z.object({ name: z.string().min(1).max(255), });
- src/tools/account.ts:85-85 (registration)Export of accountTools object that bundles the setAccountName handler (among others) for registration in the MCP server.export const accountTools = { getAccountInfo, setAccountName, setAccountPicture, setAccountPresence, setAccountStatus };
- src/server.ts:57-79 (registration)Registration logic in MCP server that includes accountTools in toolCategories and registers each tool by name in the server's tools Map.const toolCategories = [ messagingTools, contactTools, groupTools, chatTools, sessionTools, instanceTools, accountTools, ]; toolCategories.forEach(category => { Object.values(category).forEach(tool => { if (this.tools.has(tool.name)) { logger.warn(`Tool ${tool.name} already registered, skipping`); return; } this.tools.set(tool.name, tool); logger.debug(`Registered tool: ${tool.name}`); }); }); logger.info(`Registered ${this.tools.size} tools`); }