Skip to main content
Glama
ubie-oss

Slack MCP Server

by ubie-oss

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
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.
cursorNoPagination cursor for next page of results
limitNoNumber of replies to retrieve (default 100)

Implementation Reference

  • 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) }],
      };
    }
  • 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),
    },
  • Response schema used to parse the Slack API conversations.replies response.
    export const ConversationsRepliesResponseSchema = BaseResponseSchema.extend({
      messages: z.array(ConversationsHistoryMessageSchema).optional(),
    });

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/ubie-oss/slack-mcp-server'

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