slack_get_thread_replies
Retrieve all replies from a Slack message thread by providing the channel ID and thread timestamp to access conversation history.
Instructions
Get all replies in a message thread
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | The ID of the channel containing the thread | |
| thread_ts | Yes | The timestamp of the parent message in the format '1234567890.123456'. Timestamps in the format without the period can be converted by adding the period such that 6 numbers come after it. |
Implementation Reference
- index.ts:499-514 (handler)Tool handler in the CallToolRequest switch: casts arguments to GetThreadRepliesArgs, validates required fields, calls SlackClient.getThreadReplies, and returns JSON response.case "slack_get_thread_replies": { const args = request.params .arguments as unknown as GetThreadRepliesArgs; if (!args.channel_id || !args.thread_ts) { throw new Error( "Missing required arguments: channel_id and thread_ts", ); } const response = await slackClient.getThreadReplies( args.channel_id, args.thread_ts, ); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:339-351 (helper)SlackClient helper method implementing the core logic: constructs params for conversations.replies API and fetches thread replies.async getThreadReplies(channel_id: string, thread_ts: string): Promise<any> { const params = new URLSearchParams({ channel: channel_id, ts: thread_ts, }); const response = await fetch( `https://slack.com/api/conversations.replies?${params}`, { headers: this.botHeaders }, ); return response.json(); }
- index.ts:159-176 (schema)Tool definition including name, description, and input JSON schema for MCP validation.const getThreadRepliesTool: Tool = { name: "slack_get_thread_replies", description: "Get all replies in a message thread", inputSchema: { type: "object", properties: { channel_id: { type: "string", description: "The ID of the channel containing the thread", }, thread_ts: { type: "string", description: "The timestamp of the parent message in the format '1234567890.123456'. Timestamps in the format without the period can be converted by adding the period such that 6 numbers come after it.", }, }, required: ["channel_id", "thread_ts"], }, };
- index.ts:39-42 (schema)TypeScript interface defining the input arguments for type safety.interface GetThreadRepliesArgs { channel_id: string; thread_ts: string; }
- index.ts:570-581 (registration)Registration of the tool in the ListToolsRequest handler's tools array.tools: [ listChannelsTool, postMessageTool, replyToThreadTool, addReactionTool, getChannelHistoryTool, getThreadRepliesTool, getUsersTool, getUserProfileTool, lookupUserByEmailTool, ], };