AgentSkillsCN

slack-search

提供 Slack 搜索技巧与筛选器使用指南。适用于用户希望在 Slack 中查找消息、文件或信息时使用,或在询问 Slack 搜索语法、搜索修饰符(from:、in:、has:、before:、after: 等),或探讨如何过滤搜索结果时使用。

SKILL.md
--- frontmatter
name: slack-search
description: Guide for searching in Slack using search modifiers and filters. Use when the user wants to find messages, files, or information in Slack, or asks about Slack search syntax, search modifiers (from:, in:, has:, before:, after:, etc.), or how to filter search results.

Slack Search

Reference for Slack search features and modifiers.

Important: GUI vs API Syntax Differences

When using Slack search through different interfaces, the syntax differs:

Channel References (in:)

GUI (Slack app):

  • Channels (public/private): in:#team-marketing (with # prefix)
  • DMs: in:@username

API/MCP:

  • Channels (public/private): in:team-marketing or in:channel_id (without # prefix)
  • DMs: in:<@UserID> (User ID wrapped in <@>)

User References (from:, with:)

  • GUI (Slack app): Use from:@username or from:@display_name
  • API/MCP: Usually from:@username works, but if it doesn't, use from:<@UserID> (User ID wrapped in <@>)

How to Get Channel ID

Via GUI (Browser):

  1. Open Slack in your web browser
  2. Select the channel from the left-hand menu
  3. Click "View channel details"
  4. The channel ID is at the bottom
  5. Click "Copy channel ID"

Via API: Use the conversations.list API method to retrieve all channels in the workspace, then search for the Channel ID by channel name.

How to Get User ID

Via GUI:

  1. Click on the member's profile icon
  2. Click "More" (three dots ...)
  3. Click "Copy member ID"

Via API: Use the users.list API method to retrieve all users in the workspace, then search for the User ID by display name or username.

Search Modifiers List

ModifierDescriptionExample (GUI)Example (API/MCP)
"phrase"Search for a specific phrase"marketing report""marketing report"
-wordExclude a specific wordmarketing -reportmarketing -report
in:Search within a specific channel/DMin:#team-marketingin:team-marketing
from:Search for messages from a specific memberfrom:@usernamefrom:@username
has:Messages with a specific emoji reactionhas::eyes:has::eyes:
hasmy:Messages you reacted tohasmy::thumbsup:hasmy::thumbsup:
is:savedItems added to bookmarksis:savedis:saved
has:pinPinned itemshas:pinhas:pin
before:Before a specified datebefore:2024-01-01before:2024-01-01
after:After a specified dateafter:2024-01-01after:2024-01-01
on:On a specified dateon:2024-01-15on:2024-01-15
during:During a specified month/yearduring:January or during:2024during:January or during:2024
is:threadSearch within threadsis:threadis:thread
with:Search within threads/DMs with a specific memberwith:@usernamewith:@username
creator:Search for canvases created by a specific usercreator:@usernamecreator:@username
-in:Exclude a specific channel-in:#random-in:random
-from:Exclude a specific member-from:@bot-from:@bot
word*Wildcard - See results that begin with a partial word. Add an asterisk to a partial word with at least three characters to see results that begin with those specific letters.rep* → reply, reportrep* → reply, report

Combination Examples

GUI Examples

code
# Search for messages from a specific member in a channel
marketing report in:#team-marketing from:@tanaka

# Search for threads within a specific time period
project is:thread after:2024-01-01 before:2024-03-01

# Bookmarked items you reacted to
is:saved hasmy::star:

# Search excluding specific channels
API specification -in:#general -in:#random

API/MCP Examples

code
# Search for messages from a specific member in a channel
marketing report in:team-marketing from:@tanaka

# Search for threads within a specific time period
project is:thread after:2024-01-01 before:2024-03-01

# Bookmarked items you reacted to
is:saved hasmy::star:

# Search excluding specific channels
API specification -in:general -in:random

References