Skip to main content
Glama
zencoderai

Slack

by zencoderai

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
NameRequiredDescriptionDefault
channel_idYesThe ID of the channel containing the thread
thread_tsYesThe 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.
textYesThe reply text

Implementation Reference

  • 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) }],
      };
    }
  • 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) }],
        };
      }
    );
  • 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();
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zencoderai/slack-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server