Skip to main content
Glama
ExoCubeYT

OpenWA MCP Server

by ExoCubeYT

send_bulk_image

Send an image to multiple WhatsApp contacts at once using a single request. Specify recipients, image URL, and optional caption.

Instructions

Send the same image to multiple WhatsApp recipients at once

Input Schema

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

Implementation Reference

  • Tool 'send_bulk_image' is registered via server.registerTool with schema definition and async handler.
    server.registerTool(
      "send_bulk_image",
      {
        description: "Send the same image to multiple WhatsApp recipients at once",
        inputSchema: {
          sessionId: z.string().describe("Session ID to send from"),
          recipients: z.array(z.string()).describe("Array of chat IDs to send to"),
          url: z.string().describe("Public URL of the image"),
          caption: z.string().optional().describe("Optional caption for the image"),
        },
      },
      async ({ sessionId, recipients, url, caption }) => {
        const data = await openwaClient({
          method: "POST",
          path: `/sessions/${sessionId}/messages/send-bulk`,
          body: { recipients, url, caption },
        });
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • Input schema for send_bulk_image: sessionId (string), recipients (string[]), url (string), caption (optional string).
    inputSchema: {
      sessionId: z.string().describe("Session ID to send from"),
      recipients: z.array(z.string()).describe("Array of chat IDs to send to"),
      url: z.string().describe("Public URL of the image"),
      caption: z.string().optional().describe("Optional caption for the image"),
    },
  • Handler performs a POST to /sessions/{sessionId}/messages/send-bulk with recipients, url, and caption.
    async ({ sessionId, recipients, url, caption }) => {
      const data = await openwaClient({
        method: "POST",
        path: `/sessions/${sessionId}/messages/send-bulk`,
        body: { recipients, url, caption },
      });
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
  • openwaClient helper function handles HTTP calls with fetch, JSON serialization, error handling, and API key auth.
    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:6-6 (registration)
    Registration entry point: registerBulkTools is imported from src/tools/bulk.ts and called at startup.
    import { registerBulkTools } from "./tools/bulk.js";
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states the action without disclosing behavioral traits such as whether sending is synchronous, handling of invalid recipients, or rate limits.

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?

Single, efficient sentence with no wasted words. Front-loaded with core purpose.

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?

For a bulk send tool with no output schema, the description leaves many gaps: no mention of return values, error handling, or that image URL must be publicly accessible. Sibling tools exist but not referenced.

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 coverage is 100%, so baseline is 3. Description adds no meaning beyond schema; e.g., 'recipients' and 'sessionId' are not elaborated.

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?

Description clearly states the verb 'Send' and resource 'same image to multiple WhatsApp recipients at once', effectively distinguishing from sibling 'send_image' which is likely for a single recipient.

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?

Description implies when to use (when sending same image to multiple recipients) but provides no when-not or alternatives, nor prerequisites like needing a valid session or contact IDs.

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