Skip to main content
Glama
billyfranklim1

mcp-evolution

Send Media

send_media

Send image, video, audio, or document messages to WhatsApp contacts or groups using a URL or base64-encoded media.

Instructions

Send a media message (image, video, audio, document) via the pinned instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYesRecipient JID or phone number (e.g. 5511999999999 or group@g.us)
mediatypeYesMedia type: image, video, audio, or document
mediaYesURL or base64 of the media
fileNameNoOptional filename (required for document type)
captionNoOptional caption for the media

Implementation Reference

  • The async handler function that executes the send_media tool logic. It constructs a payload with number, mediatype, media, optional fileName and caption, then POSTs to /message/sendMedia/{instanceName} and returns the response.
      async (args) => {
        try {
          const payload: Record<string, unknown> = {
            number: args.number,
            mediatype: args.mediatype,
            media: args.media,
          };
          if (args.fileName) payload["fileName"] = args.fileName;
          if (args.caption) payload["caption"] = args.caption;
    
          const data = await client.post(`/message/sendMedia/${client.instanceName}`, payload);
          return {
            content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
          };
        } catch (e) {
          if (e instanceof McpError) {
            return { isError: true, content: [{ type: "text" as const, text: e.message }] };
          }
          throw e;
        }
      }
    );
  • Input schema defining the tool's input parameters: number (JID or phone), mediatype (enum: image/video/audio/document), media (URL or base64 string), fileName (optional, required for document), and caption (optional).
    const schema = {
      number: PhoneOrJidSchema,
      mediatype: z
        .enum(["image", "video", "audio", "document"])
        .describe("Media type: image, video, audio, or document"),
      media: z.string().min(1).describe("URL or base64 of the media"),
      fileName: z
        .string()
        .optional()
        .describe("Optional filename (required for document type)"),
      caption: z.string().optional().describe("Optional caption for the media"),
    };
  • Registration call invoking registerSendMedia(server, client) within the registerAllTools function.
    registerSendMedia(server, client);
  • The registerSendMedia function which registers the tool with the MCP server under the name 'send_media'.
    export function registerSendMedia(server: McpServer, client: EvolutionClient): void {
      server.registerTool(
        "send_media",
  • The EvolutionClient.post method used by the handler to send the POST request to the Evolution API.
      async post<T = unknown>(path: string, body: unknown): Promise<T> {
        return this.request<T>("POST", path, body);
      }
    
      async delete<T = unknown>(path: string, body?: unknown): Promise<T> {
        return this.request<T>("DELETE", path, body);
      }
    
      private async request<T>(method: string, path: string, body?: unknown): Promise<T> {
        const url = `${this.baseUrl}${path}`;
        const headers: Record<string, string> = {
          apikey: this.apiKey,
          "Content-Type": "application/json",
        };
    
        const res = await fetch(url, {
          method,
          headers,
          body: body !== undefined ? JSON.stringify(body) : undefined,
        });
    
        const text = await res.text();
    
        if (!res.ok) {
          throw new McpError(
            ErrorCode.InternalError,
            `Evolution API error ${res.status}: ${text}`
          );
        }
    
        try {
          return JSON.parse(text) as T;
        } catch {
          return text as unknown as T;
        }
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full responsibility for behavioral disclosure. However, it only states the action without revealing side effects, prerequisites, limitations (e.g., file size limits), or auth requirements, leaving significant gaps for an agent.

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, front-loaded sentence with no wasted words. Every element (verb, resource, types) is essential and immediately understandable.

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 5 parameters (3 required) and no output schema or annotations, the description lacks details on return values, error handling, and usage context. It is insufficient for an agent to fully understand the tool's behavior and results.

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 input schema already documents all parameters. The description adds no extra semantic meaning beyond what is already in the schema, resulting in a baseline score.

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) and resource (media message), listing specific media types (image, video, audio, document). It effectively differentiates from sibling tools by specifying scope, making it easy for an agent to identify its purpose.

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 implies usage for sending media messages of listed types, but provides no explicit guidance on when to use this tool versus alternatives like send_text or send_sticker. No exclusions or context about when not to use it are 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/billyfranklim1/mcp-evolution'

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