Search messages
tg_search_messagesSearch messages by keyword within a specific Telegram chat or across all joined chats to quickly locate relevant conversations and message context.
Instructions
Keyword search in one chat (if chat is given) or across all joined chats.
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": {
"query": "<query>"
},
"name": "tg_search_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | No | Chat: @username, username, t.me link, t.me/c/<id> link, or numeric id such as -100123… | |
| limit | No | ||
| query | Yes | ||
| fields | No | Keep only these fields in list items (e.g. ["message_id","name","size"]) | |
| format | No | compact = lists as {columns, rows} tables; saves a lot of context for long listings | json |
| account | No | Account id (see tg_list_accounts). Defaults to the default account. |