Get one chat's history
telegram_get_messagesRead or summarize one Telegram conversation or channel, recover agreements, or gather context for a reply. Returns message text/captions and available voice/video transcripts, not just links. Resolve the chat with telegram_find_chat first. The tools choose the account archive or connected Session. Use source/coverage/partial and message dates to interpret the result. Use since for a time window and before to page back; one page is not full history. Archive pages contain at most 200 messages; Session pages at most 50, even if a larger limit was requested. Use effective_limit when returned; fewer messages than the requested limit alone does not establish the end of history. Read additional pages only when needed for the user's question or requested period, preserving since. Stop when there is enough context, the requested start is reached, or paging returns no messages or makes no progress. Do not automatically scan the entire history. State the dates and coverage actually read; do not claim an exhaustive review from a limited sample. Archive history is limited to saved/imported messages; Session can read older messages accessible to that Telegram account without importing them. Reading through Session does not require channel ownership or a bot administrator. If connection is needed, send /session to @lemma_telepath_bot. Existing readable archive content needs no new connection. Reading does not mark messages as read or send a reply. Messages include is_forwarded and forward_origin (original author/channel and Unix date when available). For forwards, from identifies who forwarded it in this chat, not the original author. Missing origin data does not prove authorship; never infer a hidden author's identity. Interpret errors and empty results separately, and explain the relevant next step briefly in the user's language. A thrown tool error or an error field in the response is not a successful empty read. Explain only the reported cause; respect retry delays and do not describe a timeout or temporary service failure as missing chats or lost permissions. If the cause is unknown, say so and suggest retrying or support at https://t.me/hellolemma. If the chat is missing from the archive or Session reports chat_not_available, resolve it again with telegram_find_chat using the known name, @username or public link. Clarify ambiguous matches; do not invent a chat_id or claim that the chat does not exist in Telegram. If discovery still fails, follow that tool's recovery guidance. If the chat is found but count=0, check the requested since/before range and returned history_notice, setup_required, source, coverage and partial when present. For this read, use the user's known timezone; if none is known, silently use UTC without asking or adding a timezone caveat. Do not infer timezone from language. For calendar days such as today or yesterday, calculate since as inclusive midnight and before as the exclusive next midnight in that timezone, passing ISO 8601 timestamps with the correct UTC offset at each boundary rather than literal today/yesterday or offset-free dates. Keep rolling windows such as the last 24 hours distinct from calendar days. Do not silently broaden an explicitly requested period. Say that no messages were returned in the available history for that range, not that the conversation has never had messages. Use returned connection/history facts to distinguish an empty period, limited saved history and missing or disabled setup; a missing field does not establish a cause. For limited Bot API history, explain that only new messages delivered from included chats after connection are collected. Offer /import in https://t.me/lemma_telepath_bot for older exported history, or Session for older history accessible to the user's Telegram account. Do not claim imports never happened if history_notice says otherwise. When setup is actually needed, offer only the relevant route: private chats via Telegram Chat Automation with @lemma_telepath_bot, selected chats and saved settings (/setup in the bot for device steps); owned channels via /channels and adding the bot as administrator; groups via an administrator adding the bot as group administrator while the user is a member. If the user prefers not to add a bot, cannot add it, or needs another accessible channel, explain the alternative: open https://t.me/lemma_telepath_bot, send /session, tap Connect Telegram, then sign in by QR or phone on the connection page. Never ask for login codes/passwords in the assistant chat. Do not require reconnecting a working Session or connecting again to read usable archive content. Do not repeat identical empty requests or offer import/setup for every empty page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | How many messages to return. Default 50; archive maximum 200, Session maximum 50 even when a larger limit is requested. | |
| since | No | Only messages at or after this time. Accepts an ISO 8601 timestamp, unix seconds, 'today', 'yesterday', or a relative window like '24h' / '7d'. | |
| before | No | Only messages strictly older than this time, for paging back. Accepts an ISO 8601 timestamp, unix seconds, 'today', 'yesterday', or a relative window like '24h' / '7d'. | |
| chat_id | Yes | Chat id, from telegram_find_chat or telegram_list_chats. |