Skip to main content
Glama
EvandroSchechtel

WhatsApp Business MCP Server

get_media_url

Retrieve temporary download URLs for media files from WhatsApp Business messages to access and process customer-sent images, videos, or documents.

Instructions

Get the download URL for a received media file. URLs are valid for 5 minutes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
media_idYesMedia ID from a received message webhook

Implementation Reference

  • The implementation of the getMediaUrl method that fetches the media URL using a request.
    async getMediaUrl(mediaId: string) {
      return this.request(`/${mediaId}`);
    }
  • src/index.ts:404-414 (registration)
    The registration of the 'get_media_url' tool, which handles the user input and calls the wa.getMediaUrl method.
    server.tool(
      "get_media_url",
      "Get the download URL for a received media file. URLs are valid for 5 minutes.",
      {
        media_id: z.string().describe("Media ID from a received message webhook"),
      },
      async ({ media_id }) =>
        executeWithHooks("get_media_url", { media_id }, config, () =>
          wa.getMediaUrl(media_id)
        )
    );

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