telegram_archive_search
Search archived Telegram messages with regular expressions, sender IDs, or date ranges that Telegram's own text-only search cannot match; results come from the archive, not live.
Instructions
Costs no Telegram request at all, which is what makes regular expressions, sender filters and date ranges possible — Telegram's own search matches text only. Use when the user wants a regular expression, a sender, or a date range over messages already archived. Do not use this for a live Telegram search; call telegram_search, or telegram_archive_sync first when the chat is not archived. Every result is checked against the current read policy for its own chat, so a chat archived while it was permitted and closed since is withheld and counted. The answer always carries meta.source: archive and the timestamp of the oldest sync it covers: an archive result mistaken for a live one is stale state reported as current.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | No | Restrict to one archived chat. Omit to search every archived chat this policy still permits. | |
| limit | No | Matching messages to return. | |
| query | Yes | Substring, or a regular expression. | |
| regex | No | Treat `query` as a Python regular expression instead of a substring. This is what a live search cannot do: Telegram matches text, not patterns. | |
| since | No | Only messages at or after this ISO-8601 timestamp. | |
| until | No | Only messages at or before this ISO-8601 timestamp. | |
| sender | No | Only messages from this sender id. | |
| account | No | Account label to use. Omit when exactly one account is configured. | |
| ignore_case | No | Match without regard to case. |