telegram_search
Search Telegram messages by words in one chat or across your account, with optional context and read-policy filtering.
Instructions
Scoped to a chat, the read policy is checked once for that chat, and context may bring back the messages either side of each match, marked match: false. Use when the user asks to find messages by words, in one chat or across the account. Do not use this for a regular expression or for text already copied locally; call telegram_archive_search for that, or telegram_chat_read to page the latest history. Unscoped, every result is checked against the policy for its own chat and the number withheld is reported.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | No | Restrict to one chat. Omit to search everything this account can see. | |
| limit | No | Matching messages to return. `context` adds rows on top of this, so `meta.returned` can exceed it; `meta.matches` is what this caps. | |
| query | Yes | Text to look for. | |
| account | No | Account label to use. Omit when exactly one account is configured. | |
| context | No | Messages to include either side of each match, marked `match: false` so they are not counted as hits. Single-chat searches only; the first 10 matches get context and a warning names the rest. 0, the default, returns matches alone. | |
| before_id | No | Only messages older than this id (single-chat searches only). |