Skip to main content
Glama

waha_set_group_picture

Update WhatsApp group profile pictures by providing a group ID and image URL or base64 data through the WAHA MCP Server.

Instructions

Set or update group profile picture.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupIdYesGroup ID (format: number@g.us)
fileUrlNoURL of the image (use either fileUrl or fileData)
fileDataNoBase64 encoded image data (use either fileUrl or fileData)

Implementation Reference

  • src/index.ts:580-601 (registration)
    Registration of the waha_set_group_picture tool in the MCP ListTools handler, including input schema definition.
    {
      name: "waha_set_group_picture",
      description: "Set or update group profile picture.",
      inputSchema: {
        type: "object",
        properties: {
          groupId: {
            type: "string",
            description: "Group ID (format: number@g.us)",
          },
          fileUrl: {
            type: "string",
            description: "URL of the image (use either fileUrl or fileData)",
          },
          fileData: {
            type: "string",
            description: "Base64 encoded image data (use either fileUrl or fileData)",
          },
        },
        required: ["groupId"],
      },
    },
  • MCP tool handler function that validates input, calls WAHAClient.setGroupPicture, and returns success response.
    private async handleSetGroupPicture(args: any) {
      const groupId = args.groupId;
      const fileUrl = args.fileUrl;
      const fileData = args.fileData;
    
      if (!groupId) {
        throw new Error("groupId is required");
      }
    
      if (!fileUrl && !fileData) {
        throw new Error("Either fileUrl or fileData is required");
      }
    
      const file: any = {};
      if (fileUrl) file.url = fileUrl;
      if (fileData) file.data = fileData;
    
      await this.wahaClient.setGroupPicture({
        groupId,
        file,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully set picture for group ${groupId}.`,
          },
        ],
      };
    }
  • Underlying WAHA API client method that makes the HTTP POST request to set group picture via WAHA server.
    async setGroupPicture(params: {
      groupId: string;
      file: {
        url?: string;
        data?: string;
      };
    }): Promise<void> {
      const { groupId, file } = params;
    
      if (!groupId) {
        throw new WAHAError("groupId is required");
      }
    
      if (!file || (!file.url && !file.data)) {
        throw new WAHAError("file with url or data is required");
      }
    
      const endpoint = `/api/${this.session}/groups/${encodeURIComponent(groupId)}/picture`;
    
      const body = { file };
    
      await this.request<void>(endpoint, {
        method: "POST",
        body: JSON.stringify(body),
      });
    }

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/seejux/waha-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server