Skip to main content
Glama
telegram-archive-mcp

telegram-archive-mcp

by GeiserX

Look at a message's photo

get_media
Read-onlyIdempotent

Retrieve a Telegram message's attached photo or file, returning viewable images plus message and file metadata, or metadata only for unsupported files.

Instructions

Get the photo or file attached to one message. A JPEG, PNG, WebP or GIF image comes back as an image you can look at, scaled to at most 1568 pixels on its longest side, after a JSON text block with the message's message_id, date, sender, text (the caption) and reply_to_msg_id, and the file's media_key, kind, file_name, mime_type, size_bytes, image_returned, width, height and scaled. Any other file returns only that JSON text block, with a note saying why the file is not included.

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": {
      "chat_id": "<chat_id>",
      "message_id": "<message_id>"
    },
    "name": "get_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
chat_idYesThe chat's ref, as list_chats or search_all_chats returns it (an opaque string; not the numeric Telegram id).
message_idYesId of the message that carries the media; for a reply such as "see my picture", its reply_to_msg_id.

Output Schema

NameRequiredDescriptionDefault
dateNoNaive UTC.
kindYesphoto, document, video, geo...
noteNoWhy the file is not included, when it is not.
textNoThe caption.
widthNo
heightNo
scaledNo
senderNo
file_nameNo
media_keyYes
mime_typeNo
message_idYes
size_bytesNo
image_returnedYesTrue when an image content block follows.
reply_to_msg_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.4.1
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / chat_id / description
      Previous value: -"Chat ID (the chat's ref from list_chats)"New value: +"The chat's ref, as list_chats or search_all_chats returns it (an opaque string; not the numeric Telegram id)."
    • addedInput schema / properties / chat_id / minLength
      Added value: +1
    • changedInput schema / properties / message_id / description
      Previous value: -"ID of the message that carries the media"New value: +"Id of the message that carries the media; for a reply such as \"see my picture\", its reply_to_msg_id."
    • addedInput schema / properties / message_id / minimum
      Added value: +1
    • changedInput schema / properties / message_id / type
      Previous value: -"number"New value: +"integer"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "date": {
      +      "description": "Naive UTC.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "file_name": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "height": {
      +      "type": "integer"
      +    },
      +    "image_returned": {
      +      "description": "True when an image content block follows.",
      +      "type": "boolean"
      +    },
      +    "kind": {
      +      "description": "photo, document, video, geo...",
      +      "type": "string"
      +    },
      +    "media_key": {
      +      "type": "string"
      +    },
      +    "message_id": {
      +      "type": "integer"
      +    },
      +    "mime_type": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "note": {
      +      "description": "Why the file is not included, when it is not.",
      +      "type": "string"
      +    },
      +    "reply_to_msg_id": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "scaled": {
      +      "type": "boolean"
      +    },
      +    "sender": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "size_bytes": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "text": {
      +      "description": "The caption.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "width": {
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "message_id",
      +    "media_key",
      +    "kind",
      +    "image_returned"
      +  ],
      +  "type": "object"
      +}
  2. Addedv0.3.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already establish read-only, non-destructive behaviour, and the description adds substantial context on top: images are downscaled to max 1568px on the longest side, a JSON text block precedes the image, and non-image files return JSON only with a reason note. This tells the agent exactly what it will and won't receive.

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?

Two sentences, front-loaded with the core action and the image-scaling behaviour before the fallback case. The long enumeration of returned JSON fields is somewhat dense and partly redundant given an output schema exists, costing a point.

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?

For a two-parameter read tool with full schema coverage, complete annotations and an output schema, the description covers purpose, both outcome branches (image vs non-image) and sizing behaviour. Nothing needed to invoke it correctly is missing.

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%, so chat_id (opaque ref, not the numeric Telegram id) and message_id (including the reply_to_msg_id case) are already fully documented. The description adds nothing about parameter meaning beyond what the schema states, matching the baseline 3.

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: fetch the photo/file attached to exactly one message, keyed by chat_id + message_id. No sibling tool (get_messages, get_message_context, get_pinned_messages) does media retrieval, so the agent can distinguish it from the list alone.

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?

The description makes the use case clear — pull the attachment of a single known message — and the schema note points at reply_to_msg_id when the media sits on the replied-to message. It stops short of explicitly routing away from siblings (e.g. 'use get_messages to find the message_id first'), so no true when-not guidance.

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