Skip to main content
Glama
Telegram MCP Enhanced

Telegram MCP Enhanced

media_download

Download media from a specific Telegram message and save it to a local file with a unique name; specify the chat and message ID.

Instructions

Download media from a specific message to a unique local file.

Retrieves media from an entity specified by username, chat_id,
phone number, or 'me' and saves it to a local directory with a unique name.

!IMPORTANT: If the entity is not found, it will return an error message.
If you are not sure about the entity, use the `search_dialogs`
tool and ask the user to select the correct entity from the list.

!SECURITY: The file name comes from the sender and is untrusted external
data; it carries safety metadata like message text does. The download
location is checked against this server's file-access policy.

Args:
    entity (`str`):
        The identifier of the entity where the message exists.
        This can be a Telegram chat ID, a username, a phone number, or 'me'.

    message_id (`int`):
        The ID of the message containing the media to download.

    path (`str`, optional):
        The path to save the downloaded media.
        Defaults to a Path corresponding to `XDG_STATE_HOME`.

Returns:
    `DownloadedMedia`:
        An object containing the absolute path and media details
        of the downloaded file if successful or an error message.

Input Schema

NameRequiredDescriptionDefault
pathNo
entityYes
message_idYes

Output Schema

NameRequiredDescriptionDefault
pathYes
mediaYes
securityNo
inspectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it discloses the error behavior for unknown entities, the security treatment of the sender-supplied filename as untrusted, and that the download location is validated against a server file-access policy. It omits things like size limits, overwrite behavior on an existing path, or permission requirements.

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?

Front-loads the core action, then the important caveat and security note, so an agent skimming gets the essentials first. The Args/Returns block largely restates the input schema and the output schema, which is some avoidable bulk for a three-parameter tool.

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?

Covers purpose, entity resolution fallback, security posture, default path, and return type, which is thorough for a three-parameter tool. Because an output schema already exists, the return section is redundant rather than additive, and edge cases around write conflicts remain unaddressed.

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?

Schema coverage is 0%, so the description must supply all parameter meaning, and it does: `entity` enumerates the accepted identifier forms (chat ID, username, phone, 'me'), `message_id` is tied to the message holding the media, and `path` is described as optional with a default tied to XDG_STATE_HOME. The `path` default description is slightly vague about the concrete filename/location.

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 and resource ('Download media from a specific message') plus the destination ('a unique local file'). This is clearly distinct from siblings like get_messages (listing) and message_from_link (resolving), so an agent can select it without opening the schema.

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?

Gives an explicit failure-path rule: if the entity is not found, use `search_dialogs` and ask the user to pick the correct entity. That names an alternative and the condition that selects it. It does not, however, address when to choose this over `message_from_link` or `get_messages` for related tasks.

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