Skip to main content
Glama
z9905080

MCP Server for Slack

by z9905080

slack_get_thread_replies

Retrieve all replies from a Slack message thread by providing the channel ID and thread 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

  • Tool handler in the CallToolRequest switch: casts arguments to GetThreadRepliesArgs, validates required fields, calls SlackClient.getThreadReplies, and returns JSON 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) }],
      };
    }
  • SlackClient helper method implementing the core logic: constructs params for conversations.replies API and fetches thread replies.
    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();
    }
  • Tool definition including name, description, and input JSON schema for MCP 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"],
      },
    };
  • TypeScript interface defining the input arguments for type safety.
    interface GetThreadRepliesArgs {
      channel_id: string;
      thread_ts: string;
    }
  • index.ts:570-581 (registration)
    Registration of the tool in the ListToolsRequest handler's tools array.
      tools: [
        listChannelsTool,
        postMessageTool,
        replyToThreadTool,
        addReactionTool,
        getChannelHistoryTool,
        getThreadRepliesTool,
        getUsersTool,
        getUserProfileTool,
        lookupUserByEmailTool,
      ],
    };

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description adds minimal behavioral context. It does not disclose rate limits, authentication needs, error handling, or what happens if the thread does not exist. The only behavioral detail is the parameter description for thread_ts format, which pertains to parameter semantics, not overall tool behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no unnecessary words. It is concise and front-loaded. However, it may be slightly too brief for a tool with no annotations, as it omits additional context that could be included without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of output schema and annotations, the description does not adequately explain return format (e.g., an array of messages), whether replies are nested, or pagination behavior. The tool's complexity (2 required params) and the absence of structured metadata demand more context than provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptive parameter details, so baseline is 3. The tool description adds no additional meaning beyond the schema; it simply states the tool's function without elaborating on parameters. Thus, it does not provide extra value beyond what the schema already conveys.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get all replies in a message thread' clearly states the verb (get) and resource (replies in a thread). It effectively distinguishes this tool from siblings like slack_reply_to_thread (which creates replies) and slack_get_channel_history (which retrieves messages but not specifically thread replies).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It does not specify appropriate scenarios, prerequisites, or cases where another tool would be more suitable, leaving the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.