get_thread_replies
Retrieve replies from a Slack thread by providing the channel ID and parent message timestamp. Optionally filter to return only messages after a specified timestamp, enabling you to check for new replies.
Instructions
Get replies in a Slack thread.
Use this to check for new messages in a thread you started.
Args: channel: Channel ID containing the thread. thread_ts: Timestamp of the parent message. since_ts: Only return messages after this timestamp (optional).
Returns: Dict with success status and list of replies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| thread_ts | Yes | ||
| since_ts | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- slack_mcp/server.py:200-220 (registration)Tool registration via @mcp.tool() decorator. The get_thread_replies function is registered as an MCP tool on the FastMCP server. It imports and delegates to the actual implementation from slack_mcp/tools/messaging.py.
@mcp.tool() def get_thread_replies( channel: str, thread_ts: str, since_ts: str | None = None, ) -> dict: """Get replies in a Slack thread. Use this to check for new messages in a thread you started. Args: channel: Channel ID containing the thread. thread_ts: Timestamp of the parent message. since_ts: Only return messages after this timestamp (optional). Returns: Dict with success status and list of replies. """ from .tools.messaging import get_thread_replies as _get_thread_replies return _get_thread_replies(channel=channel, thread_ts=thread_ts, since_ts=since_ts) - slack_mcp/tools/messaging.py:163-205 (handler)Core handler implementation of get_thread_replies. Gets a Slack client, calls client.get_thread_replies to fetch thread replies from Slack API, and returns a dict with success status, reply messages (text, user, user_id, ts), and count.
def get_thread_replies( channel: str, thread_ts: str, since_ts: str | None = None, ) -> dict: """Get replies in a Slack thread. Use this to check for new messages in a thread you started. Args: channel: Channel ID containing the thread. thread_ts: Timestamp of the parent message. since_ts: Only return messages after this timestamp (optional). Returns: Dict with success status and list of replies. """ client = _get_client() try: replies = client.get_thread_replies(channel, thread_ts, since_ts) return { "success": True, "message": f"Found {len(replies)} replies", "replies": [ { "text": r.text, "user": r.user_name or r.user, "user_id": r.user, "ts": r.ts, } for r in replies ], "count": len(replies), } except RuntimeError as e: return { "success": False, "message": str(e), "replies": [], "count": 0, } - slack_mcp/slack_client.py:125-172 (helper)Low-level Slack API helper method. Uses the Slack SDK's conversations_replies API to fetch thread replies, filters out the parent message and bot messages, resolves usernames via users_info API, and returns a list of Message objects.
def get_thread_replies( self, channel: str, thread_ts: str, since_ts: str | None = None, ) -> list[Message]: """Get replies in a thread. Args: channel: Channel ID containing the thread. thread_ts: Timestamp of the parent message. since_ts: Only return messages after this timestamp. Returns: List of messages in the thread. """ try: result = self.client.conversations_replies( channel=channel, ts=thread_ts, oldest=since_ts, ) messages = [] for msg in result.get("messages", []): # Skip the parent message and bot messages if msg.get("ts") == thread_ts: continue if msg.get("bot_id"): continue if since_ts and float(msg["ts"]) <= float(since_ts): continue messages.append( Message( text=msg.get("text", ""), user=msg.get("user", ""), user_name=self._get_user_name(msg.get("user", "")), ts=msg["ts"], thread_ts=msg.get("thread_ts"), channel=channel, ) ) return messages except SlackApiError as e: raise RuntimeError(f"Failed to get thread replies: {e.response['error']}") from e - slack_mcp/tools/messaging.py:10-13 (helper)Helper function _get_client() used by the handler to create a SlackClient instance from environment configuration.
def _get_client() -> SlackClient: """Get or create a Slack client.""" config = SlackConfig.from_env() return SlackClient(config) - slack_mcp/server.py:201-205 (schema)Input schema for get_thread_replies: channel (str), thread_ts (str), since_ts (Optional[str]). These are the parameters defined in the registered tool function signature.
def get_thread_replies( channel: str, thread_ts: str, since_ts: str | None = None, ) -> dict: