Skip to main content
Glama
EvandroSchechtel

WhatsApp Business MCP Server

upload_media

Upload media files to WhatsApp Business for later use in messages. Store images, documents, or other files with a public URL to reference when sending communications.

Instructions

Upload a media file for later sending. Returns a media_id that can be used with send_media_message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_urlYesPublic URL of the file to upload
typeYesMIME type (e.g., image/jpeg, application/pdf)

Implementation Reference

  • The core logic that performs the API request to upload media to WhatsApp.
    async uploadMedia(file: string, type: string) {
      // Note: actual file upload requires multipart/form-data
      // This is a simplified version. In production, use FormData.
      return this.request(`/${this.config.phoneNumberId}/media`, "POST", {
        messaging_product: "whatsapp",
        type,
        link: file,
      });
    }
  • src/index.ts:391-402 (registration)
    Registration of the "upload_media" MCP tool.
    server.tool(
      "upload_media",
      "Upload a media file for later sending. Returns a media_id that can be used with send_media_message.",
      {
        file_url: z.string().describe("Public URL of the file to upload"),
        type: z.string().describe("MIME type (e.g., image/jpeg, application/pdf)"),
      },
      async ({ file_url, type }) =>
        executeWithHooks("upload_media", { file_url, type }, config, () =>
          wa.uploadMedia(file_url, type)
        )
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return value ('media_id') and that the file is uploaded 'for later sending,' which hints at storage and delayed use. However, it fails to disclose critical behavioral traits such as authentication requirements, rate limits, file size constraints, supported MIME types beyond examples, or whether the upload is permanent or temporary, leaving significant gaps for a mutation tool.

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 extremely concise and front-loaded, consisting of only two sentences that efficiently convey the core purpose and outcome. Every sentence earns its place: the first explains the action and intent, and the second clarifies the return value and its usage, with zero wasted words or redundancy.

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's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects like permissions, error handling, or response format beyond 'media_id,' and doesn't address how the uploaded media integrates with sibling tools. While it states the basic purpose, it doesn't provide enough context for safe and effective use in a broader workflow.

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, with clear documentation for both parameters ('file_url' and 'type'). The description adds no additional parameter semantics beyond what the schema provides, such as format details or constraints. According to the rules, with high schema coverage (>80%), the baseline score is 3, as the description doesn't need to compensate but also doesn't add value here.

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 tool's purpose: 'Upload a media file for later sending.' It specifies the verb ('upload') and resource ('media file'), and distinguishes it from siblings like 'send_media_message' by indicating it's for preparation rather than direct sending. However, it doesn't explicitly differentiate from 'get_media_url' or other media-related tools, preventing a perfect score.

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 by stating the tool returns a 'media_id that can be used with send_media_message,' suggesting it's a prerequisite for sending media. However, it lacks explicit guidance on when to use this versus alternatives like 'send_media_message' directly (if available) or other upload methods, and doesn't mention any exclusions or prerequisites beyond the implied workflow.

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/EvandroSchechtel/mcp-whatsapp'

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