search_messages
Search messages across Slack workspaces using query strings with modifiers like in:#channel, from:@user, and date filters to find specific conversations.
Instructions
Search messages across the Slack workspace.
Note: Requires a User Token (SLACK_USER_TOKEN) as search is not
available with bot tokens.
Args:
query: Search query string. Supports Slack search modifiers:
- "in:#channel" to search in specific channel
- "from:@user" to search messages from a user
- "has:reaction" to find messages with reactions
- "before:YYYY-MM-DD" or "after:YYYY-MM-DD" for date filters
Example: "project update in:#general from:@john"
sort: Sort order - "timestamp" or "score". Default: "timestamp"
sort_dir: Sort direction - "asc" or "desc". Default: "desc"
count: Number of results to return (1-100). Default: 20
Returns:
Dictionary containing search results with messages and metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| sort | No | timestamp | |
| sort_dir | No | desc | |
| count | No |