Skip to main content
Glama
larrygmaguire-hash

Slack Note Capture MCP Server

slack_wait_for_reply

Ask a question in Slack and wait for a human response by polling a thread until reply appears or timeout occurs.

Instructions

Poll a thread waiting for a user reply. Posts an initial message if provided, then polls until a non-bot reply appears or timeout is reached. Use this when you need to ask the user a question and wait for their response via Slack.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idNoThe Slack channel ID. Defaults to configured inbox channel.
thread_tsNoThe timestamp of an existing thread to monitor. If not provided, message must be provided to start a new thread.
messageNoMessage to post (starts a new thread if thread_ts not provided, or posts to existing thread).
poll_interval_secondsNoSeconds between poll attempts. Default: 30
timeout_minutesNoMaximum minutes to wait for a reply. Default: 15

Implementation Reference

  • The handler implementation for the `slack_wait_for_reply` tool in src/index.js. It polls a Slack thread for new, non-bot messages until a reply is found or a timeout is reached.
    case "slack_wait_for_reply": {
      const channelId = args.channel_id || DEFAULT_CHANNEL;
      let threadTs = args.thread_ts;
      const message = args.message;
      const pollInterval = (args.poll_interval_seconds || 30) * 1000;
      const timeoutMs = (args.timeout_minutes || 15) * 60 * 1000;
    
      if (!channelId) {
        return {
          content: [
            {
              type: "text",
              text: "Error: No channel ID provided and no default channel configured.",
            },
          ],
        };
      }
    
      if (!threadTs && !message) {
        return {
          content: [
            {
              type: "text",
              text: "Error: Either thread_ts or message must be provided.",
            },
          ],
        };
      }
    
      const botId = await getBotUserId();
    
      // Post initial message if provided
      if (message) {
        const postResult = await slack.chat.postMessage({
          channel: channelId,
          text: message,
          thread_ts: threadTs, // Will be undefined for new thread, which is fine
        });
    
        // If this was a new thread, use the message ts as thread_ts
        if (!threadTs) {
          threadTs = postResult.ts;
        }
      }
    
      const startTime = Date.now();
      let lastCheckedTs = threadTs;
    
      // Poll for replies
      while (Date.now() - startTime < timeoutMs) {
        await sleep(pollInterval);
    
        const result = await slack.conversations.replies({
          channel: channelId,
          ts: threadTs,
        });
    
        const messages = result.messages || [];
    
        // Find non-bot replies after our last check
        const newUserReplies = messages.filter(
          (msg) =>
            msg.user !== botId &&
            msg.ts !== threadTs && // Exclude parent message
            parseFloat(msg.ts) > parseFloat(lastCheckedTs)
        );
    
        if (newUserReplies.length > 0) {
          // Found a reply!
          const latestReply = newUserReplies[newUserReplies.length - 1];
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  {
                    success: true,
                    reply_received: true,
                    channel: channelId,
                    thread_ts: threadTs,
                    reply: {
                      ts: latestReply.ts,
                      text: latestReply.text,
                      user: latestReply.user,
                      date: new Date(parseFloat(latestReply.ts) * 1000).toISOString(),
                    },
                    wait_duration_seconds: Math.round((Date.now() - startTime) / 1000),
                  },
                  null,
                  2
                ),
              },
            ],
          };
        }
    
        // Update last checked timestamp
        if (messages.length > 0) {
          lastCheckedTs = messages[messages.length - 1].ts;
        }
      }
    
      // Timeout reached
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                success: false,
                reply_received: false,
                reason: "timeout",
                channel: channelId,
                thread_ts: threadTs,
                timeout_minutes: args.timeout_minutes || 15,
                hint: "No reply received within the timeout period. You can call slack_read_thread later to check for replies.",
              },
              null,
              2
            ),
          },
        ],
      };
    }
Behavior4/5

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

With no annotations, the description carries full burden and discloses key behaviors: it 'Posts an initial message' (mutation), 'polls until a non-bot reply appears' (filtering logic), and 'timeout is reached' (termination condition). Missing explicit disclosure of what the tool returns (reply content, message object, or null) and that it blocks execution during polling.

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?

Two efficient sentences with zero waste. First sentence front-loads the action and mechanism; second sentence provides usage context. Every clause earns its place with no redundant repetition of schema details.

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?

Given the complexity (blocking polling operation) and lack of output schema, the description lacks critical details about the return value (what constitutes the 'reply' data returned) and could more explicitly warn about the blocking/long-running nature of the operation. Adequate but incomplete for full operational context.

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

Parameters4/5

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

Schema has 100% coverage (baseline 3). Description adds value by explaining parameter interactions: 'Posts an initial message if provided' clarifies the conditional requirement between message and thread_ts, and explains the polling loop encompassing poll_interval_seconds and timeout_minutes.

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?

Description uses specific verbs 'Poll' and 'waiting' with clear resource 'thread' and 'user reply'. Clearly distinguishes from sibling tools like slack_post_message (one-way) and slack_read_thread (passive read) by emphasizing the active waiting/polling behavior for interactive responses.

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

Usage Guidelines4/5

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

Explicitly states 'Use this when you need to ask the user a question and wait for their response via Slack', providing clear context for when to select this over alternatives. Could be improved by explicitly naming alternatives (e.g., slack_post_message) for cases when waiting isn't needed.

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/larrygmaguire-hash/slack-note-capture'

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