messages_search_recent
Find a recently sent message by keyword by scanning a Discord channel's recent messages and filtering them client-side, so you can locate content without manual iteration.
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.
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_id": "<channel_id>",
"query": "<query>"
},
"name": "messages_search_recent"
}
}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 | |||