Update Profile Picture
update_profile_pictureUpdate the profile picture of your pinned WhatsApp instance by providing a Base64 encoded image or a URL. Ensure the image is valid and accessible.
Instructions
Update the profile picture of the pinned WhatsApp instance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| picture | Yes | Base64 encoded image or URL for the profile picture |
Implementation Reference
- The async handler that sends the POST request to /chat/updateProfilePicture/:instanceName with the picture data and returns the result.
async (args) => { try { const data = await client.post(`/chat/updateProfilePicture/${client.instanceName}`, { picture: args.picture, }); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } catch (e) { if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] }; throw e; } } ); } - Zod schema defining the 'picture' input parameter (Base64 or URL, min length 1).
const schema = { picture: z.string().min(1).describe("Base64 encoded image or URL for the profile picture"), }; - src/tools/update-profile-picture.ts:10-29 (registration)The registerUpdateProfilePicture function that registers the tool with the MCP server under the name 'update_profile_picture'.
export function registerUpdateProfilePicture(server: McpServer, client: EvolutionClient): void { server.registerTool( "update_profile_picture", { title: "Update Profile Picture", description: "Update the profile picture of the pinned WhatsApp instance.", inputSchema: schema, }, async (args) => { try { const data = await client.post(`/chat/updateProfilePicture/${client.instanceName}`, { picture: args.picture, }); return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] }; } catch (e) { if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] }; throw e; } } ); - src/tools/index.ts:111-111 (registration)Registration call in the central tools index that wires up update_profile_picture.
registerUpdateProfilePicture(server, client);