Skip to main content
Glama
oregpt

Slack MCP Server

by oregpt

conversations_replies

Retrieve threaded message conversations from Slack channels using channel ID and thread timestamp, with pagination support for handling long discussions.

Instructions

Fetches all messages in a specific thread by channel and thread timestamp. Supports pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessTokenYesSlack OAuth token (xoxp-... or xoxb-...)
channel_idYesChannel ID (e.g., C1234567890), channel name (#general), or DM (@username)
thread_tsYesMessage timestamp in format 1234567890.123456
limitNoTime range (1d, 7d, 1m, 90d) or message count (e.g., 100)
cursorNoPagination cursor from previous response
include_activity_messagesNoInclude join/leave system messages (default: false)

Implementation Reference

  • The handler function that executes the conversations_replies tool. Validates input, resolves channel ID, calls Slack conversations.replies API, filters messages, and returns formatted response.
    export async function conversationsReplies(args: any): Promise<ToolResponse> {
      try {
        const validated = ConversationsRepliesSchema.parse(args);
        const client = new WebClient(validated.accessToken);
    
        console.log('Fetching thread replies for channel:', validated.channel_id, 'thread:', validated.thread_ts);
    
        // Resolve channel name/username to ID if needed
        const channelId = await resolveChannelId(client, validated.channel_id);
    
        // Parse limit parameter
        const limitParams = parseLimit(validated.limit);
    
        // Fetch thread replies
        const result = await client.conversations.replies({
          channel: channelId,
          ts: validated.thread_ts,
          cursor: validated.cursor,
          ...limitParams
        });
    
        // Filter out activity messages if not requested
        let messages = result.messages || [];
        if (!validated.include_activity_messages) {
          messages = messages.filter((msg: any) => !msg.subtype || !['channel_join', 'channel_leave'].includes(msg.subtype));
        }
    
        return {
          success: true,
          data: {
            messages,
            has_more: result.has_more,
            cursor: result.response_metadata?.next_cursor,
            channel_id: channelId,
            thread_ts: validated.thread_ts
          }
        };
      } catch (error: any) {
        if (error.name === 'ZodError') {
          return { success: false, error: `Validation error: ${error.errors.map((e: any) => e.message).join(', ')}` };
        }
        return handleSlackError(error);
      }
    }
  • Zod schema defining the input parameters and validation for the conversations_replies tool.
    export const ConversationsRepliesSchema = z.object({
      accessToken: z.string().describe("Slack OAuth token (xoxp-... or xoxb-...)"),
      channel_id: z.string().describe("Channel ID (e.g., C1234567890), channel name (#general), or DM (@username)"),
      thread_ts: z.string().describe("Message timestamp in format 1234567890.123456"),
      limit: z.union([z.string(), z.number()]).optional().describe("Time range (1d, 7d, 1m, 90d) or message count (e.g., 100)"),
      cursor: z.string().optional().describe("Pagination cursor from previous response"),
      include_activity_messages: z.boolean().optional().describe("Include join/leave system messages (default: false)")
    });
  • src/index.ts:100-104 (registration)
    Registers the conversations_replies tool in the MCP server's tool list, providing name, description, and input schema.
    {
      name: 'conversations_replies',
      description: 'Fetches all messages in a specific thread by channel and thread timestamp. Supports pagination.',
      inputSchema: zodToMCPSchema(ConversationsRepliesSchema)
    },
  • src/index.ts:133-135 (registration)
    Dispatches execution of the conversations_replies tool in the server's callTool handler switch statement.
    case 'conversations_replies':
      result = await conversationsReplies(args);
      break;
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions pagination support, which is valuable behavioral context. However, it doesn't disclose other important traits like rate limits, authentication requirements (though schema covers token), error conditions, or response format details.

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

Conciseness5/5

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

The description is extremely concise (two sentences) with zero wasted words. It's front-loaded with the core purpose and follows with important behavioral information about pagination. Every sentence earns its place.

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

Completeness3/5

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

For a read operation with 6 parameters and no output schema, the description provides adequate but minimal context. It covers the core purpose and pagination behavior but lacks details about response format, error handling, or how results are structured. With no annotations and no output schema, more completeness would be beneficial.

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 description coverage is 100%, so the schema already documents all 6 parameters thoroughly. The description adds minimal value beyond the schema - it mentions 'channel and thread timestamp' which maps to channel_id and thread_ts parameters, but doesn't provide additional semantic context beyond what's in the parameter descriptions.

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

Purpose4/5

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

The description clearly states the action ('fetches all messages') and target resource ('in a specific thread by channel and thread timestamp'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like conversations_history, which might also fetch messages but from different contexts.

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

Usage Guidelines3/5

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

The description implies usage context ('specific thread') but doesn't explicitly state when to use this tool versus alternatives like conversations_history (for channel messages) or conversations_add_message (for adding messages). No explicit exclusions or prerequisites are mentioned.

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

Install Server

Other Tools

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/oregpt/Agenticledger_MCP_Slack'

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