Skip to main content
Glama
ExoCubeYT

OpenWA MCP Server

by ExoCubeYT

get_profile_picture

Retrieve the profile picture URL of a WhatsApp contact by providing a session ID and contact ID.

Instructions

Get the profile picture URL for a WhatsApp contact

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID
contactIdYesContact ID

Implementation Reference

  • Registration of the 'get_profile_picture' tool on the MCP server, with input schema (sessionId, contactId) and handler that calls the OpenWA API.
    server.registerTool(
      "get_profile_picture",
      {
        description: "Get the profile picture URL for a WhatsApp contact",
        inputSchema: {
          sessionId: z.string().describe("Session ID"),
          contactId: z.string().describe("Contact ID"),
        },
      },
      async ({ sessionId, contactId }) => {
        const data = await openwaClient({ method: "GET", path: `/sessions/${sessionId}/contacts/${contactId}/picture` });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • Handler function that makes a GET request to /sessions/{sessionId}/contacts/{contactId}/picture to retrieve the profile picture URL.
    async ({ sessionId, contactId }) => {
      const data = await openwaClient({ method: "GET", path: `/sessions/${sessionId}/contacts/${contactId}/picture` });
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
  • Input schema definition for get_profile_picture tool: sessionId (string) and contactId (string).
    {
      description: "Get the profile picture URL for a WhatsApp contact",
      inputSchema: {
        sessionId: z.string().describe("Session ID"),
        contactId: z.string().describe("Contact ID"),
      },
    },
  • The openwaClient helper function used by the handler to make HTTP requests to the OpenWA API.
    export async function openwaClient<T = unknown>(opts: RequestOptions): Promise<T> {
      const url = `${BASE_URL}${opts.path}`;
    
      const headers: Record<string, string> = {
        "Content-Type": "application/json",
        "X-API-Key": API_KEY,
      };
    
      const res = await fetch(url, {
        method: opts.method,
        headers,
        body: opts.body ? JSON.stringify(opts.body) : undefined,
      });
    
      const text = await res.text();
    
      if (!res.ok) {
        throw new Error(`OpenWA API ${res.status}: ${text}`);
      }
    
      try {
        return JSON.parse(text) as T;
      } catch {
        return text as T;
      }
    }
  • src/index.ts:8-8 (registration)
    Import of registerContactTools which registers the get_profile_picture tool.
    import { registerContactTools } from "./tools/contacts.js";
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It does not mention what happens if the contact does not exist, whether authentication is needed, or the format of the returned URL. The description is too minimal for behavioral transparency.

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 sentence that is directly to the point with no unnecessary words. It is highly concise and well-structured for quick comprehension.

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?

Given the simplicity of the tool (2 parameters, no output schema), the description is somewhat incomplete. It does not specify the return type (e.g., string URL) or behavior on missing contacts. However, for a straightforward get operation, it meets a basic baseline.

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?

The input schema has 100% description coverage, so the schema already explains the parameters (sessionId and contactId). The description adds no additional meaning beyond the schema, resulting in a baseline score of 3.

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

Purpose5/5

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

The description clearly states the action (Get) and the resource (profile picture URL for a WhatsApp contact). It distinguishes well from sibling tools, which are primarily for messaging, group management, and other operations.

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 does not provide any guidance on when to use this tool versus alternatives, nor does it mention prerequisites or exclusions. It is implied that this tool is for retrieving a profile picture, but no explicit context is given.

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/ExoCubeYT/openwa-mcp'

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