Search messages in a dialog
search_messagesSearch messages in any Telegram chat using text, sender, media type, and date filters to quickly locate specific conversations or files.
Instructions
Search messages within one dialog. Supports text substring, type filter (photos/links/etc), sender filter, and date range. Newest first unless reverse=true.
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": {
"peer": "<peer>"
},
"name": "search_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| peer | Yes | Dialog id or @username | |
| limit | No | ||
| query | No | Substring to match in the message text | |
| filter | No | Media/content type filter | |
| maxDate | No | Unix seconds — exclude messages newer than this | |
| minDate | No | Unix seconds — exclude messages older than this | |
| reverse | No | Oldest first when true | |
| fromUser | No | Username (@nick) or numeric id of the sender to filter by | |
| accountId | No |