Skip to main content
Glama
ExoCubeYT

OpenWA MCP Server

by ExoCubeYT

send_image

Deliver an image to a WhatsApp chat using a publicly accessible URL and optional caption.

Instructions

Send an image to a WhatsApp chat by providing a publicly accessible URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID to send from
chatIdYesTarget chat ID
urlYesPublic URL of the image
captionNoOptional caption for the image

Implementation Reference

  • The handler function for the 'send_image' tool. It sends an image to a WhatsApp chat by making a POST request to the OpenWA API with sessionId, chatId, url, and optional caption.
    async ({ sessionId, chatId, url, caption }) => {
      const data = await openwaClient({
        method: "POST",
        path: `/sessions/${sessionId}/messages/send-image`,
        body: { chatId, url, caption },
      });
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
  • The input schema for 'send_image', defining required fields (sessionId, chatId, url) and optional caption.
    {
      description: "Send an image to a WhatsApp chat by providing a publicly accessible URL",
      inputSchema: {
        sessionId: z.string().describe("Session ID to send from"),
        chatId: z.string().describe("Target chat ID"),
        url: z.string().describe("Public URL of the image"),
        caption: z.string().optional().describe("Optional caption for the image"),
      },
  • Tool registration for 'send_image' via server.registerTool within registerMessageTools function.
    server.registerTool(
      "send_image",
      {
        description: "Send an image to a WhatsApp chat by providing a publicly accessible URL",
        inputSchema: {
          sessionId: z.string().describe("Session ID to send from"),
          chatId: z.string().describe("Target chat ID"),
          url: z.string().describe("Public URL of the image"),
          caption: z.string().optional().describe("Optional caption for the image"),
        },
      },
      async ({ sessionId, chatId, url, caption }) => {
        const data = await openwaClient({
          method: "POST",
          path: `/sessions/${sessionId}/messages/send-image`,
          body: { chatId, url, caption },
        });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • 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;
      }
    }
Behavior2/5

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

With no annotations, the description fails to disclose behavioral details such as whether the session must be active, side effects on the chat, rate limits, or return values. The minimal text does not compensate for the absent annotation context.

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, focused sentence that immediately conveys the core purpose. It is front-loaded and contains no redundant information, making it efficient for agent comprehension.

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 tool has 4 parameters, no output schema, and no annotations, the description is insufficient for an agent to understand the full operational context—such as expected outputs, error conditions, or lifecycle (e.g., does it wait for send confirmation?).

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?

Although the input schema has 100% coverage with clear parameter descriptions, the tool description adds no additional meaning beyond restating the URL requirement. Baseline is met but no extra value is provided.

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 ('send an image') and context ('to a WhatsApp chat'), and specifies the mechanism ('publicly accessible URL'), which effectively distinguishes it from sibling tools like send_video or upload_media.

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 vs. alternatives (e.g., upload_media for private images), nor prerequisites like requiring an active session or valid chat ID. This lack of usage direction increases the risk of incorrect tool selection.

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