messages_search_recent
Search recent messages in a Discord channel for a substring keyword to locate specific messages without manual scrolling, returning matches plus scan metadata.
Instructions
Purpose: Substring-search recent messages in a channel.
When to use:
Locate a recently sent message by keyword without iterating manually.
When NOT to use:
Server-wide search → not supported by Discord REST. This tool only fans out the most recent N messages of ONE channel and filters client-side. For deep history, use external indexing.
Example: {channel_id:"111122223333444401", query:"deploy", limit:100}
Returns: {matches:[…], scanned_count, oldest_scanned_id?, newest_scanned_id?, channel_id, query}. Structured matches remain raw Discord data; the human-readable MCP content response fences matched message text. Resume older history with before: oldest_scanned_id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | Scan window: messages after this ID (newer); mutually exclusive with before | |
| limit | No | Max recent messages to scan (1-100, default 100). NOT a result cap. | |
| query | Yes | Substring to match (case-insensitive) | |
| before | No | Scan window: messages before this ID (older); mutually exclusive with after | |
| channel_id | Yes | Channel to scan |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||