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)
        )
    );
Behavior4/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 effectively adds critical context beyond the schema by specifying that 'URLs are valid for 5 minutes,' which is a key behavioral trait (temporary validity) not inferable from the input schema alone. However, it does not cover other potential behaviors like error conditions or authentication needs.

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 with only two sentences, both of which earn their place by providing essential information (purpose and URL validity). It is front-loaded with the core function and wastes no words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is reasonably complete. It covers the purpose and a key behavioral constraint (5-minute validity). However, without annotations or output schema, it could benefit from mentioning response format or error handling, but the gaps are minor for this simple tool.

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 schema already documents the single parameter (media_id) with its description. The description does not add any further meaning or details about the parameter beyond what the schema provides, meeting the baseline for high schema coverage.

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 specific action ('Get the download URL') and resource ('for a received media file'), distinguishing it from sibling tools like upload_media or send_media_message. It precisely defines the tool's function without ambiguity.

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 context by specifying 'received media file' and mentioning webhook origin in the parameter description, but it does not explicitly state when to use this tool versus alternatives like send_media_message or upload_media. No exclusions or prerequisites are provided.

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