Skip to main content
Glama

Download media

download_media
Idempotent

Download an image, video, audio, document, or sticker attached to a WhatsApp message and return its local path using the message ID and chat JID from list_messages.

Instructions

Download the media (image, video, audio, document, sticker) attached to a message and return its local path. Use the id and chat_jid of a list_messages result whose media_type is set.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "message_id": "<message_id>",
      "chat_jid": "<chat_jid>"
    },
    "name": "download_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
chat_jidYeschat_jid of that message
message_idYesid of the media message (from list_messages)

Output Schema

NameRequiredDescriptionDefault
pathYesabsolute path of the downloaded file
sizeYes
cachedYestrue when the file had already been downloaded
filenameYes
media_typeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false with idempotentHint=true and destructiveHint=false; the description adds the important behavioral fact that the call materializes a file locally and returns its path, plus the media_type precondition. It omits where files are written, overwrite/duplicate behavior on repeated calls, and size or rate limits, which matter for a non-readOnly filesystem operation. Useful additions, but not full disclosure.

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?

Two sentences, front-loaded with purpose then the invocation recipe, with zero redundant wording. Every clause (media types, local path, source message condition) carries information the agent needs.

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?

An output schema covers the returned path structure and annotations cover the safety profile, so the description only needs purpose, preconditions, and side effects — all present. The remaining gap is operational detail about the local filesystem destination and error cases, which is minor for a two-parameter 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 coverage is 100% and both parameter descriptions already name the fields and their origin in list_messages. The description only adds the media_type precondition on the source message, which is modest added meaning over the schema. Baseline 3 is appropriate.

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?

States a specific verb (Download) and resource (media attached to a message), enumerates the media types handled, and adds the outcome (returns its local path). This is clearly distinct from siblings like send_file or get_message_context, which deal with sending or describing messages rather than pulling attachment bytes.

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

Usage Guidelines4/5

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

Explicitly routes the agent through a prerequisite: use the id and chat_jid from a list_messages result whose media_type is set. This is a concrete when-to-use condition tied to a named sibling. It stops short of stating what to do when media_type is absent (e.g., fall back to get_message_context) or when a download fails.

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