Skip to main content
Glama

WhatsMCP: MCP for WhatsApp

Get Media

wa_get_media
Read-only

Fetch the attachment (image/video/audio/document/sticker) a received WhatsApp message carried. A small attachment comes back as base64 in media_base64; a large one comes back as media_url, a time-limited link to GET the bytes. Use the message_id from wa_list_messages. 'refused' means no retrievable media for that id.

Input Schema

NameRequiredDescriptionDefault
account_idNothe account that received the message, from wa_list_accounts; omit it when the workspace has only one account
message_idYesthe message id whose attachment to fetch, from wa_list_messages (a WhatsApp message id, or on a Telegram account one of the form <chat>_<n>)

Output Schema

NameRequiredDescriptionDefault
mimeNo
sizeNothe attachment size in bytes
statusYesok (media returned, inline or as a url) or refused
refusalNo
media_urlNoa time-limited (1h) URL to GET a large attachment's bytes, present instead of media_base64 when the attachment is over the inline cap
media_base64Nobase64 of the attachment, present for a small attachment

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / account_id / description
      Previous value: -"the account that received the message, from wa_list_accounts"New value: +"the account that received the message, from wa_list_accounts; omit it when the workspace has only one account"
    • changedInput schema / required
      Previous value: -[
      -  "account_id",
      -  "message_id"
      -]New value: +[
      +  "message_id"
      +]
    • addedOutput schema / properties / refusal / properties / candidates
      Added value: +{
      +  "description": "on an account_ambiguous refusal: the accounts to choose from — retry with one of these as account_id",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "account_id": {
      +        "description": "the id to retry with as account_id",
      +        "type": "string"
      +      },
      +      "name": {
      +        "description": "the account's WhatsApp display name",
      +        "type": "string"
      +      },
      +      "phone": {
      +        "description": "the account's phone number, E.164",
      +        "type": "string"
      +      },
      +      "status": {
      +        "description": "whether the number works right now — live, connecting, or why not, as wa_list_accounts reports it",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "account_id"
      +    ],
      +    "type": "object"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / message_id / description
      Previous value: -"the WhatsApp message id whose attachment to fetch, from wa_list_messages"New value: +"the message id whose attachment to fetch, from wa_list_messages (a WhatsApp message id, or on a Telegram account one of the form <chat>_<n>)"
  3. Changed4 schema fields changed
    • changedOutput schema / properties / media_base64 / description
      Previous value: -"base64 of the attachment, present when status is ok"New value: +"base64 of the attachment, present for a small attachment"
    • addedOutput schema / properties / media_url
      Added value: +{
      +  "description": "a time-limited (1h) URL to GET a large attachment's bytes, present instead of media_base64 when the attachment is over the inline cap",
      +  "type": "string"
      +}
    • addedOutput schema / properties / size
      Added value: +{
      +  "description": "the attachment size in bytes",
      +  "type": "integer"
      +}
    • changedOutput schema / properties / status / description
      Previous value: -"ok (media returned) or refused"New value: +"ok (media returned, inline or as a url) or refused"
  4. Changed3 schema fields changed
    • addedOutput schema / properties / refusal / properties / account_status
      Added value: +{
      +  "description": "when the number is not working: its status — starting, not_running, whatsapp_down, suspended, pairing, unlinked or locked",
      +  "type": "string"
      +}
    • addedOutput schema / properties / refusal / properties / account_status_reason
      Added value: +{
      +  "description": "the detail of account_status, e.g. no_egress, stopped, no_plan",
      +  "type": "string"
      +}
    • addedOutput schema / properties / refusal / properties / since
      Added value: +{
      +  "description": "when the number stopped working, RFC3339, when known",
      +  "type": "string"
      +}
  5. First observed

TDQS

A4.8/5.0
Behavior5/5

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

The description goes far beyond standard annotations by detailing the behavioral differences in the output: small attachments return `media_base64` while large ones return a `media_url`. It also explains the meaning of the 'refused' status.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense and informative but logically structured. It front-loads the primary function and then elaborates on the operational details (output types, failure modes) and dependency.

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

Completeness5/5

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

The definition is complete for this specific use case. It covers what is fetched, how the output will look (URL vs Base64), the required input source, and the negative result, which covers all necessary concerns for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description provides essential semantic guidance by specifying that `message_id` must be retrieved specifically from `wa_list_messages`. This context is vital for correct orchestration.

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 tool is clearly defined to fetch media attachments (image/video/audio/etc.) from a received WhatsApp message. The naming convention and description immediately establish its purpose within the communication context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a crucial usage dependency: the `message_id` must be sourced from the `wa_list_messages` tool, preventing agents from using arbitrary IDs. It also defines the failure state ('refused').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources