Search messages
search_messagesSearches Discord messages by text, author, mentions, attachments, pinned status, and date range across server history or a single channel, returning message IDs and channels for follow-up context.
Instructions
Finds messages by text, author, mentions, attachments/links (has), pinned state and date range. Uses Discord's server-wide search when available (whole history, all channels). Otherwise, or if scan: true, it scans one channel's history up to scan_limit and states exactly how much it scanned. Results include message IDs and channels; use get_message or read_messages around=ID for context.
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 | Only messages that have all of these. | |
| scan | No | Skip server search and scan the channel history directly. | |
| sort | No | Server search only (default newest). | |
| after | No | Only after this ISO date or message ID. | |
| guild | No | Server ID or name. Optional if DISCORD_GUILD_ID is set or the bot is in one server. | |
| limit | No | Max results (1-25, default 25). | |
| query | No | Text the message must contain. | |
| author | No | Only messages by this user (ID, mention or name). | |
| before | No | Only before this ISO date or message ID. | |
| cursor | No | next_cursor from a previous call. | |
| pinned | No | ||
| channel | No | Limit to one channel or thread (ID, mention, link or name). | |
| mentions | No | Only messages that mention this user. | |
| scan_limit | No | Max messages to scan (default and cap: GUILDORA_SCAN_LIMIT). |