search_messages
Search Discord messages in a server or channel by text, author, mentions, attachments, or date range, and filter results to pinned messages.
Instructions
Search messages like the Discord search bar: in a server (guild_id) or a DM/channel (channel_id). Filter by text, author, mentions, attachments/links (has), channel, date range, pinned.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| has | No | Message has: link, embed, poll, file, video, image, sound, sticker, snapshot (forward) | |
| after | No | After this date (ISO8601) | |
| limit | No | 1-25 (default 25) | |
| before | No | Before this date (ISO8601) | |
| offset | No | Pagination offset (multiples of 25) | |
| pinned | No | ||
| content | No | Text to search for | |
| sort_by | No | ||
| guild_id | No | Server to search in | |
| mentions | No | Mentioning these user IDs | |
| author_id | No | From these user IDs | |
| channel_id | No | Limit to this channel (or search a DM/group DM by its channel ID without guild_id) | |
| sort_order | No | ||
| author_type | No | user, bot, webhook (prefix - to exclude) | |
| include_nsfw | No |