Look at a message's photo
get_mediaRetrieve 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
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | The chat's ref, as list_chats or search_all_chats returns it (an opaque string; not the numeric Telegram id). | |
| message_id | Yes | Id of the message that carries the media; for a reply such as "see my picture", its reply_to_msg_id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Naive UTC. | |
| kind | Yes | photo, document, video, geo... | |
| note | No | Why the file is not included, when it is not. | |
| text | No | The caption. | |
| width | No | ||
| height | No | ||
| scaled | No | ||
| sender | No | ||
| file_name | No | ||
| media_key | Yes | ||
| mime_type | No | ||
| message_id | Yes | ||
| size_bytes | No | ||
| image_returned | Yes | True when an image content block follows. | |
| reply_to_msg_id | No |