Skip to main content
Glama

waha_get_contact_profile_picture

Retrieve a WhatsApp contact's profile picture URL using their contact ID. Specify whether to fetch a fresh image from the server or use cached data.

Instructions

Get contact's profile picture URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contactIdYesContact ID (format: number@c.us)
refreshNoRefresh from server (default: false)

Implementation Reference

  • src/index.ts:939-957 (registration)
    Tool registration in ListToolsRequestSchema handler, defines name, description, and input schema.
    {
      name: "waha_get_contact_profile_picture",
      description: "Get contact's profile picture URL.",
      inputSchema: {
        type: "object",
        properties: {
          contactId: {
            type: "string",
            description: "Contact ID (format: number@c.us)",
          },
          refresh: {
            type: "boolean",
            description: "Refresh from server (default: false)",
            default: false,
          },
        },
        required: ["contactId"],
      },
    },
  • MCP tool handler function that validates input, calls WAHA client method, and returns formatted URL response.
    private async handleGetContactProfilePicture(args: any) {
      const contactId = args.contactId;
      const refresh = args.refresh || false;
    
      if (!contactId) {
        throw new Error("contactId is required");
      }
    
      const result = await this.wahaClient.getContactProfilePicture({
        contactId,
        refresh,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Profile picture URL for ${contactId}:\n${result.url}\n${refresh ? '(Refreshed from server)' : '(From cache)'}`,
          },
        ],
      };
    }
  • WAHA client helper method that constructs API endpoint and makes HTTP GET request to retrieve contact profile picture URL.
    async getContactProfilePicture(params: {
      contactId: string;
      refresh?: boolean;
    }): Promise<{ url: string }> {
      const { contactId, refresh } = params;
    
      if (!contactId) {
        throw new WAHAError("contactId is required");
      }
    
      const queryParams: Record<string, any> = { 
        contactId,
        session: this.session
      };
      if (refresh !== undefined) {
        queryParams.refresh = refresh;
      }
    
      const queryString = this.buildQueryString(queryParams);
      const endpoint = `/api/contacts/profile-picture${queryString}`;
    
      const response = await this.request<{ profilePictureURL?: string; url?: string }>(endpoint, {
        method: "GET",
      });
    
      // Handle both response formats: profilePictureURL (contacts) or url (chats)
      return { url: response.profilePictureURL || response.url || '' };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool retrieves a URL but doesn't disclose behavioral traits such as whether it requires specific permissions, if it's cached (implied by the 'refresh' parameter but not explained), rate limits, or what happens if the contact has no picture. This leaves significant gaps for an agent to understand the operation fully.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that is front-loaded with the core purpose. There is no wasted language, and it efficiently communicates the essential action without unnecessary details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a tool that retrieves data (with no output schema) and no annotations, the description is incomplete. It doesn't explain the return value (e.g., URL format, error cases), behavioral aspects like caching or permissions, or how it differs from sibling tools. This leaves the agent with insufficient context for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('contactId' and 'refresh') with descriptions. The description adds no additional meaning beyond what's in the schema, such as explaining the format of the URL returned or the implications of the 'refresh' parameter. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'contact's profile picture URL', making the purpose specific and understandable. However, it doesn't distinguish this tool from similar siblings like 'waha_get_chat_picture' or 'waha_get_group_picture', which also retrieve profile pictures but for different entities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't mention when to use 'waha_get_contact' (which might include profile info) or 'waha_get_chat_picture' versus this tool. The description lacks context about prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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-whatsapp-mcp'

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