tg_search_messages
Find messages in one Telegram chat via server-side full-text search with filters for type, sender, date, or topic; results include snippets and a next-page cursor.
Instructions
Server-side full-text search inside one chat - the fast path for
"find X in this channel". Results are newest first, with snippet, link and
a next_offset_id cursor. For context around a hit use tg_get_messages
with around_id.
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_search_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | Yes | Chat reference: @username, t.me link, or numeric chat id. | |
| kind | No | Message type filter. | any |
| limit | No | ||
| query | No | Text query. Empty is allowed only with kind or topic_id. | |
| sender | No | Only messages from this @username or user id. | |
| max_date | No | ISO date or unix timestamp; a date-only value means end of day. | |
| min_date | No | ISO date (2025-01-31) or unix timestamp. | |
| topic_id | No | Forum topic id. | |
| offset_id | No | Cursor: return messages older than this id. | |
| max_text_chars | No | Maximum characters of message text per message. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||