slack_reply_to_thread
Post replies to specific message threads in Slack channels to maintain organized conversations and follow discussions.
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 | |
| 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. | |
| text | Yes | The reply text |
Implementation Reference
- index.ts:277-282 (handler)MCP tool handler: extracts parameters and calls slackClient.postReply, then returns formatted response.async ({ channel_id, thread_ts, text }) => { const response = await slackClient.postReply(channel_id, thread_ts, text); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:268-275 (schema)Tool metadata including title, description, and Zod input schema for parameters.{ title: "Reply to Slack Thread", description: "Reply to a specific message thread in Slack", inputSchema: { channel_id: z.string().describe("The ID of the channel containing the thread"), thread_ts: z.string().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."), text: z.string().describe("The reply text"), },
- index.ts:266-283 (registration)Registration of the 'slack_reply_to_thread' tool on the MCP server, including schema and inline handler.server.registerTool( "slack_reply_to_thread", { title: "Reply to Slack Thread", description: "Reply to a specific message thread in Slack", inputSchema: { channel_id: z.string().describe("The ID of the channel containing the thread"), thread_ts: z.string().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."), text: z.string().describe("The reply text"), }, }, async ({ channel_id, thread_ts, text }) => { const response = await slackClient.postReply(channel_id, thread_ts, text); return { content: [{ type: "text", text: JSON.stringify(response) }], }; } );
- index.ts:124-140 (helper)SlackClient.postReply method: core implementation that calls Slack's chat.postMessage API with thread_ts to reply in thread.async postReply( channel_id: string, thread_ts: string, text: string, ): Promise<any> { const response = await fetch("https://slack.com/api/chat.postMessage", { method: "POST", headers: this.botHeaders, body: JSON.stringify({ channel: channel_id, thread_ts: thread_ts, text: text, }), }); return response.json(); }