Skip to main content
Glama

waha_get_chat_picture

Retrieve WhatsApp chat profile picture URLs with optional cache refresh for chat identification and management.

Instructions

Get the profile picture URL for a chat. Uses 24-hour cache by default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatIdYesChat ID (format: number@c.us)
refreshNoRefresh from server instead of using cache (default: false)

Implementation Reference

  • Primary MCP tool handler for 'waha_get_chat_picture'. Validates args, calls WAHAClient.getChatPicture(), formats and returns the picture URL response.
      const chatId = args.chatId;
      const refresh = args.refresh || false;
    
      if (!chatId) {
        throw new Error("chatId is required");
      }
    
      const result = await this.wahaClient.getChatPicture({
        chatId,
        refresh,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Chat picture URL for ${chatId}:\n${result.url}\n${refresh ? '(Refreshed from server)' : '(From 24h cache)'}`,
          },
        ],
      };
    }
  • src/index.ts:327-345 (registration)
    Tool registration definition in ListToolsRequestSchema handler, including name, description, and input schema for validation.
    {
      name: "waha_get_chat_picture",
      description: "Get the profile picture URL for a chat. Uses 24-hour cache by default.",
      inputSchema: {
        type: "object",
        properties: {
          chatId: {
            type: "string",
            description: "Chat ID (format: number@c.us)",
          },
          refresh: {
            type: "boolean",
            description: "Refresh from server instead of using cache (default: false)",
            default: false,
          },
        },
        required: ["chatId"],
      },
    },
  • src/index.ts:1077-1078 (registration)
    Switch case registration in CallToolRequestSchema handler that routes calls to the tool handler function.
    case "waha_get_chat_picture":
      return await this.handleGetChatPicture(args);
  • WAHAClient helper method that performs the actual HTTP GET request to the WAHA API endpoint /api/{session}/chats/{chatId}/picture to retrieve the chat picture URL.
    async getChatPicture(params: {
      chatId: string;
      refresh?: boolean;
    }): Promise<{ url: string }> {
      const { chatId, refresh } = params;
    
      if (!chatId) {
        throw new WAHAError("chatId is required");
      }
    
      const queryParams: Record<string, any> = {};
      if (refresh !== undefined) {
        queryParams.refresh = refresh;
      }
    
      const queryString = this.buildQueryString(queryParams);
      const endpoint = `/api/${this.session}/chats/${encodeURIComponent(
        chatId
      )}/picture${queryString}`;
    
      return this.request<{ url: string }>(endpoint, {
        method: "GET",
      });
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively adds valuable context beyond the input schema by specifying the caching behavior ('Uses 24-hour cache by default'), which is a key operational trait not captured in the schema. This helps the agent understand performance and data freshness implications.

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 perfectly concise and front-loaded: a single sentence that states the core purpose, followed by a second sentence adding crucial behavioral context. Every word earns its place with zero waste or redundancy.

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

Completeness3/5

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

For a simple read operation with no annotations and no output schema, the description provides adequate context about caching behavior. However, it doesn't describe the return value format (e.g., URL structure, error conditions), which would be helpful given the lack of output schema. The description is complete enough for basic use but has room for improvement.

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 fully documents both parameters (chatId format, refresh default). The description adds no additional parameter semantics beyond what's in the schema, but doesn't need to compensate for gaps. 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 action ('Get the profile picture URL') and resource ('for a chat'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'waha_get_contact_profile_picture' or 'waha_get_group_picture', which serve similar functions 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 Guidelines3/5

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

The description provides implied usage context through the mention of '24-hour cache by default' and the 'refresh' parameter, suggesting when to use the cache vs. fresh data. However, it lacks explicit guidance on when to choose this tool over similar sibling tools (e.g., waha_get_contact_profile_picture for contacts vs. chats).

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