Search chat messages matching a query and filters. This tool searches **across every chat the caller can see** (subject to chatTypes), so it is the right tool for a workspace-wide pulse, what is going on across all conversations, not just one. Prefer it over fanning out per-chat with chat_history when you want broad situational awareness. By default, searches every indexed chat type the caller can see, DMs, channels, teamRoam, and meeting channels (Magic Minutes summaries and other meeting-channel posts). Use chatTypes to narrow to specific types. To list recent messages across chats without a search query, use sort: "recent" with an empty query. Examples: - Search all chats: {"query": "budget report"} - List recent activity across the workspace: {"sort": "recent"} - List recent teamRoam messages: {"sort": "recent", "chatTypes": ["teamRoam"]} - List recent DMs: {"sort": "recent", "chatTypes": ["address"]} - Drop noisy automated channels: {"sort": "recent", "excludeChatIds": ["<chatId-from-prior-result>"]} - Drop a noisy bot sender: {"sort": "recent", "excludeUserIds": ["<userId-from-prior-result>"]} When summarizing recent activity, follow a two-pass workflow: 1. First pass: call chat_search with sort: "recent" and no exclusions to see who is posting where. 2. If a small number of chats or senders dominate the results with automated/bot noise (CI bots, deploy bots, alert webhooks, etc.), call chat_search again with those chat IDs in excludeChatIds and/or those sender userIds in excludeUserIds. The second pass should surface human conversation. Parameters: - query (optional): Search text - chatTypes (optional): Filter by chat type, array of "channel", "teamRoam", "address", or "meetingChannel" (default: all indexed types). - in (optional): Group names to search within - from (optional): Sender email addresses - with (optional): Conversation participant emails - excludeChatIds (optional): Chat IDs to exclude. Populate from the chatId field on prior results to drop automated/noisy channels. - excludeUserIds (optional): Sender user IDs to exclude. Populate from the `userId` field on prior results to drop automated/bot senders. - before/after (optional): Date filters (YYYY-MM-DD). Both are optional, omit both to search all time. Never set before and after to the same date (returns nothing). Dates are treated as midnight, so to search a single day like 2024-04-14, use after: "2024-04-14" and before: "2024-04-15". - has (optional): "mention" or "item" - sort (optional): "relevant" (default) or "recent". For recent messages with no query, prefer sort "recent" with no date filters. - limit (optional): Max results per page - cursor (optional): Pagination cursor from previous response Each returned message carries: - `timestamp`, RFC3339 send time (with microsecond precision). Pass back into chat_post, chat_update, chat_delete, reaction_* as-is. - `threadTimestamp`, RFC3339 thread root (only on replies / when replying to a thread). - `userId`, UUID of the sender (resolve via the response envelope's `addresses` map; see below). - `text`, canonical message text with Slack-syntax mention tokens: `<@uuid>` for principals (users and bots), `<!subteam^uuid>` for groups and channels, and `<!channel>` for the broadcast. Tokens are never rewritten by the server. - `mentions`, flat list of payloads referenced by mention tokens in `text`: bare address UUIDs (from both `<@uuid>` and `<!subteam^uuid>` tokens) and the literal `"all"` for `<!channel>`. Order-preserving and deduplicated. The response envelope additionally carries an `addresses` map keyed by UUID, every sender and mention-target address referenced on this page, with display name, type (`user`/`bot`/`userGroup`/`standardGroup`/`meetingGroup`/`teamRoam`), and type-specific fields (e.g. `botCode`, `email`, `isGuest`). Replace `<@<uuid>>` and `<!subteam^<uuid>>` in `text` with `@` + `addresses.<uuid>.displayName` to render, and `<!channel>` with `@all`. The map omits IDs the caller is not authorized to view (cross-roam bots, private cross-account groups, etc.), render those as `@unknown`. For excludeUserIds, pass the `userId` field from a prior result (matches the wire shape).
Parameters
Only include messages sent after this date (YYYY-MM-DD, treated as midnight). Optional; omit both before and after to search all time.
Only include messages sent before this date (YYYY-MM-DD, treated as midnight). Optional; omit both before and after to search all time. Never set before and after to the same date, since the range would be empty.
Restrict results to specific chat types: channel, teamRoam, address (DMs), or meetingChannel (Magic Minutes and other meeting-channel posts). Defaults to searching all indexed types the caller can see.
Pagination cursor from a previous response, used to fetch the next page of results.
Chat UUIDs to exclude from results, typically populated from the chatId field of a prior noisy/automated result to drop that channel on a follow-up search.
Sender user UUIDs to exclude from results, typically populated from the userId field of a prior result to drop a noisy bot or automated sender on a follow-up search.
Restrict results to messages sent by these sender email addresses.
Restrict results to messages that have a mention or an attached item.
Restrict the search to messages within these group/channel names.
Maximum number of results to return per page.
Free-text search query to match against message content across the caller's visible chats. Leave empty (with sort set to recent) to list recent activity instead of searching.
How to order results: relevant (default) ranks by relevance to query, recent sorts newest-first. Use recent with an empty query to list recent activity across chats. One of: `relevant`, `recent`. Default: `relevant`.
Restrict results to conversations that include these participant email addresses.