slack_reply_to_thread
Post a reply to a specific message thread in Slack by providing channel ID, text content, and parent message timestamp.
Instructions
Reply to a specific message thread in Slack
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | The ID of the channel containing the thread | |
| text | Yes | The reply text | |
| 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
- src/index.ts:219-236 (handler)Handler for slack_reply_to_thread: parses input with ReplyToThreadRequestSchema, posts message to Slack thread using slackClient.chat.postMessage, handles error and returns success response.case 'slack_reply_to_thread': { const args = ReplyToThreadRequestSchema.parse( request.params.arguments ); const response = await slackClient.chat.postMessage({ channel: args.channel_id, thread_ts: args.thread_ts, text: args.text, }); if (!response.ok) { throw new Error(`Failed to reply to thread: ${response.error}`); } return { content: [ { type: 'text', text: 'Reply sent to thread successfully' }, ], }; }
- src/schemas.ts:204-217 (schema)Zod input schema for slack_reply_to_thread tool defining channel_id (string), text (string), and thread_ts (string with regex validation for Slack timestamp format).export const ReplyToThreadRequestSchema = z.object({ channel_id: z .string() .describe('The ID of the channel containing the thread'), text: z.string().describe('The reply text'), 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." ), });
- src/index.ts:126-130 (registration)Tool registration in listTools response: defines name, description, and inputSchema for slack_reply_to_thread.{ name: 'slack_reply_to_thread', description: 'Reply to a specific message thread in Slack', inputSchema: zodToJsonSchema(ReplyToThreadRequestSchema), },