Skip to main content
Glama
luiso2

Evolution API WhatsApp MCP Server

by luiso2

send_media

Send images, videos, audio, or documents via WhatsApp Business API to recipients with optional captions and file names for business communication.

Instructions

Send media (image, video, audio, document)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
captionNoMedia caption
fileNameNoFile name for documents
instanceNameYesInstance name
mediaYesMedia URL or base64
mediatypeYesType of media
numberYesRecipient phone number

Implementation Reference

  • Tool definition for 'send_media' including input schema for validation.
    {
      name: 'send_media',
      description: 'Send media (image, video, audio, document)',
      inputSchema: {
        type: 'object',
        properties: {
          instanceName: { type: 'string', description: 'Instance name' },
          number: { type: 'string', description: 'Recipient phone number' },
          mediatype: {
            type: 'string',
            enum: ['image', 'video', 'audio', 'document'],
            description: 'Type of media'
          },
          media: { type: 'string', description: 'Media URL or base64' },
          caption: { type: 'string', description: 'Media caption' },
          fileName: { type: 'string', description: 'File name for documents' }
        },
        required: ['instanceName', 'number', 'mediatype', 'media']
      }
    },
  • src/index.ts:470-472 (registration)
    Registration of all tools list including send_media for ListToolsRequest.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools
    }));
  • MCP handler function for send_media tool that invokes evolutionAPI.sendMedia.
    private async handleSendMedia(args: any) {
      const result = await evolutionAPI.sendMedia(args.instanceName, {
        number: args.number,
        mediatype: args.mediatype,
        media: args.media,
        caption: args.caption,
        fileName: args.fileName
      });
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Dispatch case in CallToolRequest handler routing to send_media handler.
    case 'send_media':
      return await this.handleSendMedia(args);
  • Helper method in EvolutionAPI service that performs the HTTP POST to send media via Evolution API.
    async sendMedia(instanceName: string, data: {
      number: string;
      mediatype: 'image' | 'video' | 'audio' | 'document';
      mimetype?: string;
      caption?: string;
      media: string; // base64 or URL
      fileName?: string;
    }): Promise<Message> {
      const response = await this.client.post(`/message/sendMedia/${instanceName}`, data);
      return response.data;
    }
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. 'Send' implies a write/mutation operation, but the description doesn't disclose behavioral traits like whether this requires authentication, what happens on failure, rate limits, or side effects (e.g., media storage). It mentions media types but not operational details like supported formats or size limits. For a mutation tool with zero annotation coverage, this is inadequate.

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?

Extremely concise single sentence with no wasted words. It front-loads the core purpose ('Send media') and efficiently enumerates media types in parentheses. Every word earns its place, making it easy to parse quickly.

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 mutation tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't cover behavioral aspects (auth, errors, side effects), output expectations, or usage context. While schema coverage is high, the description fails to compensate for the lack of annotations and output schema, leaving critical gaps for agent decision-making.

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 parameters are well-documented in the schema. The description adds minimal value beyond the schema by listing media types (which are already in the enum for 'mediatype'). It doesn't explain parameter interactions (e.g., 'fileName' is only for documents) or provide context beyond what's in schema descriptions. Baseline 3 is appropriate given high schema coverage.

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 ('Send') and resource ('media') with specific media types enumerated (image, video, audio, document). It distinguishes from sibling tools like send_text, send_template, send_buttons, and send_list by focusing on media files rather than text or structured messages. However, it doesn't specify the destination or platform context beyond what's implied by sibling tools.

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 explicit guidance on when to use this tool versus alternatives like send_text or send_template. The description implies it's for sending media files, but doesn't clarify prerequisites (e.g., instance must be connected), constraints (e.g., file size limits), or when other media-related tools might be more appropriate. Usage is inferred from the name and parameter context alone.

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/luiso2/mcp-evolution-api'

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