slack_get_thread_replies
Retrieve all replies from a Slack message thread by providing channel ID and parent message timestamp, enabling comprehensive conversation review and analysis.
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. | |
| cursor | No | Pagination cursor for next page of results | |
| limit | No | Number of replies to retrieve (default 100) |
Implementation Reference
- src/index.ts:271-289 (handler)The handler function for slack_get_thread_replies that parses input arguments, calls slackClient.conversations.replies API, validates response with schema, and returns JSON stringified result.case 'slack_get_thread_replies': { const args = GetThreadRepliesRequestSchema.parse( request.params.arguments ); const response = await slackClient.conversations.replies({ channel: args.channel_id, ts: args.thread_ts, limit: args.limit, cursor: args.cursor, }); if (!response.ok) { throw new Error(`Failed to get thread replies: ${response.error}`); } const parsedResponse = ConversationsRepliesResponseSchema.parse(response); return { content: [{ type: 'text', text: JSON.stringify(parsedResponse) }], }; }
- src/schemas.ts:136-160 (schema)Input schema (Zod) for the tool defining parameters: channel_id, thread_ts (validated timestamp format), optional cursor and limit.export const GetThreadRepliesRequestSchema = z.object({ channel_id: z .string() .describe('The ID of the channel containing the thread'), thread_ts: z .string() .regex(/^\d{10}\.\d{6}$/, { message: "Timestamp must be in the format '1234567890.123456'", }) .describe( "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." ), cursor: z .string() .optional() .describe('Pagination cursor for next page of results'), limit: z .number() .int() .min(1) .max(1000) .optional() .default(100) .describe('Number of replies to retrieve (default 100)'), });
- src/index.ts:142-146 (registration)Registration of the tool in the ListToolsRequestHandler, specifying name, description, and inputSchema.{ name: 'slack_get_thread_replies', description: 'Get all replies in a message thread', inputSchema: zodToJsonSchema(GetThreadRepliesRequestSchema), },
- src/schemas.ts:394-396 (schema)Response schema used to parse the Slack API conversations.replies response.export const ConversationsRepliesResponseSchema = BaseResponseSchema.extend({ messages: z.array(ConversationsHistoryMessageSchema).optional(), });