search_messages
Search messages in a Telegram channel, group, or private chat by query and date filters to locate relevant conversations.
Instructions
Search for messages in a Telegram channel, group, or private chat
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": {
"channel": "<channel>",
"query": "<query>"
},
"name": "search_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tz | No | IANA time zone used to resolve date-only sinceDate and 'today'/'yesterday' (e.g., Europe/Kyiv). Default: UTC | |
| limit | No | Number of messages to retrieve (default: 10, max: 100) | |
| query | Yes | Search query | |
| channel | Yes | Channel username (@channelname), group username, private chat username (@username), phone number (+1234567890), or chat ID | |
| offsetId | No | Return matches older than this message ID | |
| sinceDate | No | Search messages since this date. Accepts a full ISO datetime, a plain date (midnight in tz), or 'today' / 'yesterday' | |
| sinceHours | No | Search messages from the last N hours | |
| sinceMinutes | No | Search messages from the last N minutes | |
| maxTextLength | No | Truncate each message text to this many characters |