Read Telegram messages
read-telegram-messagesRead one page of synced Telegram chat messages newest first, filter by date range or forum topic, and page through older messages until the requested range is covered.
Instructions
[Telegram] Read one page of synced messages from one Telegram chat, newest first. Takes the chatId from list-telegram-chats, as a string. Use since/until to target a date range and topicId for one topic of a forum supergroup. A response is one page: when hasMore is true there are older messages you have not seen, so call again with nextPage and the same chatId, limit and window, and keep going until hasMore is false before treating the range as read. covered is the span this page actually covers; totalMatching counts the messages in the range. When history.complete is false, the chat has older messages that were never synced: reaching hasMore: false then means you reached the oldest synced message, not the start of the conversation, and note says why. history.gapSince means edits or deletions around that time may be missing. Telegram edits messages in place: text is the current wording, editedAt says it changed, and the earlier wording is not available. Deleted messages are left out and counted in deletedExcluded; their text is not kept. Service messages (joins, pins, title changes) are left out unless includeService is set, counted in serviceMessagesExcluded. Reactions are not kept, so a message carries no reaction data. A message you sent is marked fromMe and carries no author. To find a message by what it says, use search-telegram-messages instead of paging.
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": {
"chatId": "<chatId>"
},
"name": "read-telegram-messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | 1-based page of `limit` messages, counting back from the newest. Walk this up while `hasMore` is true. | |
| limit | No | How many messages to return in this page | |
| since | No | Only messages at or after this date, e.g. 2024-03-01 or 2024-03-01T12:00:00Z | |
| until | No | Only messages at or before this date. Pass back `window.until` from a previous page when paging a range. | |
| chatId | Yes | Chat id from list-telegram-chats, as a string, e.g. "-1001234567890" | |
| topicId | No | In a forum supergroup, only messages in this topic | |
| includeDeleted | No | Include deleted messages as placeholders with no text. Off by default. | |
| includeService | No | Include service messages: joins, leaves, pins, title and photo changes. Off by default. |