Home / Servers / Slack API / search_messages

Searches for messages matching a query.

An MCP tool from the Slack API server, hosted on mcp.hjlabs.in.

Searches for messages matching a query. [GET /search.messages]

Name on the gateway: slack_api__search_messages · read-only.

Parameters

NameTypeDescription
token requiredstringAuthentication token. Requires scope: search:read
countintegerPass the number of results you want per "page". Maximum of 100.
highlightbooleanPass a value of true to enable query highlight markers (see below).
pageintegerpage parameter
query requiredstringSearch query.
sortstringReturn matches sorted by either score or timestamp.
sort_dirstringChange sort direction to ascending (asc) or descending (desc).

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "slack_api__search_messages",
  "arguments": {
    "token": "…",
    "query": "…"
  }
}

Or connect the Slack API server directly, which lists 174 tools including this one:

Run in your terminal
claude mcp add --transport http hj-slack-api https://mcp.hjlabs.in/mcp/slack-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the searches for messages matching a query. tool with token set to ….

More from Slack API