Read messages
tg_get_messagesRead a Telegram chat’s message history, newest first, with paging and filters for date range, message ID, keyword, or media-only results.
Instructions
Read a chat's history (newest first by default). Page with offset_id=next_offset_id. Supports date range, id range, keyword and media-only.
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": "<chat>"
},
"name": "tg_get_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | Yes | Chat: @username, username, t.me link, t.me/c/<id> link, or numeric id such as -100123… | |
| limit | No | ||
| query | No | Keyword search | |
| since | No | ||
| until | No | ||
| fields | No | Keep only these fields in list items (e.g. ["message_id","name","size"]) | |
| format | No | compact = lists as {columns, rows} tables; saves a lot of context for long listings | json |
| max_id | No | ||
| min_id | No | ||
| account | No | Account id (see tg_list_accounts). Defaults to the default account. | |
| text_max | No | Max characters per message text | |
| offset_id | No | Continue after this id (paging cursor) | |
| media_only | No | ||
| oldest_first | No |