Skip to main content
Glama
z9905080
by z9905080

slack_get_thread_replies

Retrieve all message replies from a Slack thread using channel ID and parent message timestamp to access conversation history.

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.

Implementation Reference

  • Executes the slack_get_thread_replies tool logic: validates arguments using GetThreadRepliesArgs interface, calls SlackClient.getThreadReplies method, and formats the response.
    case "slack_get_thread_replies": { const args = request.params .arguments as unknown as GetThreadRepliesArgs; if (!args.channel_id || !args.thread_ts) { throw new Error( "Missing required arguments: channel_id and thread_ts", ); } const response = await slackClient.getThreadReplies( args.channel_id, args.thread_ts, ); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
  • Defines the Tool object for slack_get_thread_replies, including name, description, and inputSchema for validation.
    const getThreadRepliesTool: Tool = { name: "slack_get_thread_replies", description: "Get all replies in a message thread", inputSchema: { type: "object", properties: { channel_id: { type: "string", description: "The ID of the channel containing the thread", }, thread_ts: { type: "string", description: "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.", }, }, required: ["channel_id", "thread_ts"], }, };
  • SlackClient helper method that performs the actual API call to retrieve thread replies using Slack's conversations.replies endpoint.
    async getThreadReplies(channel_id: string, thread_ts: string): Promise<any> { const params = new URLSearchParams({ channel: channel_id, ts: thread_ts, }); const response = await fetch( `https://slack.com/api/conversations.replies?${params}`, { headers: this.botHeaders }, ); return response.json(); }
  • index.ts:570-580 (registration)
    Registers the slack_get_thread_replies tool (via getThreadRepliesTool) in the ListToolsRequest handler by including it in the array of available tools.
    tools: [ listChannelsTool, postMessageTool, replyToThreadTool, addReactionTool, getChannelHistoryTool, getThreadRepliesTool, getUsersTool, getUserProfileTool, lookupUserByEmailTool, ],
  • TypeScript interface defining the input arguments for slack_get_thread_replies tool, used for type checking in handler.
    interface GetThreadRepliesArgs { channel_id: string; thread_ts: string; }

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/z9905080/mcp-slack'

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