Search Messages Within Specific Chat
search_messagesFind past Telegram conversations by searching text keywords within a specific chat or supergroup. Locate relevant messages using chat ID, username, or phone number.
Instructions
Search for text keywords within a specific Telegram chat or supergroup. Use when finding past conversations in a single chat. To search the offline cache without live Telegram API calls, use search_cached_messages.
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_id": "<chat_id>",
"query": "<query>"
},
"name": "search_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of items or records to retrieve (integer between 1 and 100). | |
| query | Yes | Search text string or keywords to match against messages, contacts, or entities. | |
| account | No | Optional account label for multi-account environments. If omitted in single-mode, the default account is used. In multi-mode without an account, read-only tools fan out across all configured accounts. | |
| chat_id | Yes | Target Telegram chat, group, supergroup, channel, or user identifier. Accepts numeric chat ID (e.g. -1001234567890 or 123456789), username (e.g. '@channel'), or phone number. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |