Read a chat's messages
get_messagesRetrieve messages from a Telegram chat newest first, page older history with offset or date/id cursor, filter by forum topic, and fetch messages after an id for incremental browsing.
Instructions
Get messages from a Telegram chat, newest first. Page with offset, or with the keyset cursor: pass the date and id of the last message you received as before_date and before_id to get the older ones (constant time on huge chats). after_id returns the messages right after an id. Dates are naive UTC. Each message carries reply_to_msg_id and, when it has a file, media (pass its id to get_media).
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>"
},
"name": "get_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum messages to return, 1 to 500 (default 50). | |
| offset | No | Messages to skip, 0 to 100000 (default 0). Slow deep into a long chat; ignored when a cursor is given. | |
| chat_id | Yes | The chat's ref, as list_chats or search_all_chats returns it (an opaque string; not the numeric Telegram id). | |
| after_id | No | Returns the messages right after this message id (newer), still newest first. | |
| topic_id | No | Forum topic id from get_topics; keeps only that topic's messages. 1 is the General topic. Omit for the whole chat. | |
| before_id | No | Keyset cursor: message id. Returns messages with a smaller id; pair with before_date. | |
| before_date | No | Keyset cursor: ISO 8601 date-time, naive values are UTC (e.g. 2026-06-10T18:04:17). Returns messages older than this instant; pair with before_id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messages | No | Archived messages as the viewer returns them: id, date (naive UTC), text, sender fields, reply_to_msg_id, media and more. |