get_recent_messages
Retrieve recent messages from a Telegram channel, group, or private chat with date, time, and pagination filters so you can review conversations and detect empty activity windows.
Instructions
Get recent messages from a Telegram channel, group, or private chat. Returns resolved channel info (id/peer/username/type), hasMore/nextOffsetId for pagination, and lastMessageDate so an empty window can be told apart from a dead channel.
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": {
"channel": "<channel>"
},
"name": "get_recent_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tz | No | IANA time zone used to resolve date-only sinceDate and 'today'/'yesterday' (e.g., Europe/Kyiv). Default: UTC | |
| limit | No | Number of recent messages to retrieve (default: 10, max: 100) | |
| fields | No | Return only these per-message fields. Valid: id, date, timestamp, sender, text, messageType, isOutgoing, mediaType, groupedId, link, forwardedFrom, views, replyToMsgId, textTruncated | |
| channel | Yes | Channel username (@channelname), bare numeric id (1496296645), -100-prefixed id (-1001496296645), private chat username (@username), or phone number | |
| offsetId | No | Return messages older than this message ID (pass nextOffsetId from the previous page to paginate) | |
| sinceDate | No | Get messages since this date. Accepts a full ISO datetime (2023-12-01T10:00:00Z), a plain date (2023-12-01, midnight in tz), or 'today' / 'yesterday' | |
| sinceHours | No | Get messages from the last N hours | |
| excludeMedia | No | Omit media-only messages (no text and no caption) | |
| sinceMinutes | No | Get messages from the last N minutes | |
| maxTextLength | No | Truncate each message text to this many characters (adds textTruncated: true) |