tg_search
Search across Telegram chats or within one chat. Filter by text, attachment kind, date, author, or tag; use local engine for morphology-aware results.
Instructions
Full-text search across all chats, or inside one chat when chat is given.
Two engines. "server" (default) asks Telegram: every chat, always current, but substring-only — morphology defeats it, the past-tense "dogovorilis" does not find "dogovorimsya". "local" searches the sqlite index built by tg_index: instant, ranked, morphology-aware, filterable by author, but only over the chats actually indexed. An empty local answer says what to index.
Args: query: text to look for. May be empty when filtering by kind, tag or (local only) author and period. A trailing "" on a word means prefix search in the local engine ("rent"). chat: restrict to one chat; omit to search everywhere. limit: how many messages to return. kind: attachment filter, same tabs as tg_media ("photo", "file", "music", "voice", "link", ...). Combine with an empty query to list, say, every document someone sent. since: ISO date — stop once messages get older than this. until: ISO date — start from this point back in time. tag: Saved Messages tag (chat="me" only), the same labels shown in Telegram. tg_saved_tags lists them. Server engine only. engine: "server" (Telegram) or "local" (the tg_index database). author: local engine only — whose messages, by name substring, or "me" for your own. brief: drop reactions, link cards and edit times. Same messages, about a quarter smaller — for triage, not for reading a chat closely.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | ||
| chat | No | ||
| kind | No | ||
| brief | No | ||
| limit | No | ||
| query | No | ||
| since | No | ||
| until | No | ||
| author | No | ||
| engine | No | server |