Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Jan 14, 2026

Summary

  • added get message by timestamp tool
  • added get thread tool

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 14, 2026 2:32am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 14, 2026

Greptile Summary

Added two new Slack tools for retrieving messages: slack_get_message retrieves a single message by timestamp using conversations.history, and slack_get_thread retrieves complete thread conversations using conversations.replies.

  • Implemented proper TypeScript interfaces for both tools with comprehensive message object structure
  • Added UI configuration in Slack block with wand AI-assist for timestamp extraction from URLs
  • Registered both tools in the global registry and exported from Slack module
  • Created complete documentation for both tools
  • Included proper error handling for missing scopes, invalid auth, and not-found scenarios
  • Thread retrieval supports pagination with configurable limits (default 100, max 200)
  • Both tools properly separate parent messages from replies and include full message metadata

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is well-structured with proper error handling, TypeScript typing, and follows existing patterns in the codebase. The tools use the correct Slack API endpoints, include comprehensive documentation, and have proper integration with the block system. The previous review concern about using conversations.replies for single messages has been addressed by using conversations.history in the get_message tool.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/tools/slack/get_message.ts Added new tool to retrieve a specific Slack message by timestamp using conversations.history API with proper error handling
apps/sim/tools/slack/get_thread.ts Added new tool to retrieve entire Slack thread with parent message and replies using conversations.replies API, includes pagination support
apps/sim/tools/slack/types.ts Added TypeScript interfaces for new get_message and get_thread tools with proper typing for parameters and responses
apps/sim/blocks/blocks/slack.ts Added UI configuration and parameter mapping for get_message and get_thread operations with wand AI-assist for timestamp extraction
apps/docs/content/docs/en/tools/slack.mdx Added comprehensive documentation for the two new Slack tools with parameter descriptions and output schemas

Sequence Diagram

sequenceDiagram
    participant User
    participant Block as Slack Block
    participant GetMsg as get_message Tool
    participant GetThread as get_thread Tool
    participant SlackAPI as Slack API

    alt Get Single Message
        User->>Block: Provide channel & timestamp
        Block->>GetMsg: slack_get_message(channel, timestamp)
        GetMsg->>SlackAPI: GET conversations.history<br/>(oldest=timestamp, limit=1, inclusive=true)
        SlackAPI-->>GetMsg: Return message data
        GetMsg->>GetMsg: Transform to SlackMessage format
        GetMsg-->>User: Return message object
    end

    alt Get Thread
        User->>Block: Provide channel & thread_ts
        Block->>GetThread: slack_get_thread(channel, threadTs, limit?)
        GetThread->>SlackAPI: GET conversations.replies<br/>(ts=threadTs, limit=100-200, inclusive=true)
        SlackAPI-->>GetThread: Return messages array
        GetThread->>GetThread: Split into parent & replies
        GetThread-->>User: Return parentMessage, replies, replyCount, hasMore
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 changed the title feat(slack): added get message by timestamp tool feat(slack): added get message by timestamp and get thread tool Jan 14, 2026
@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1 waleedlatif1 merged commit 6e0055f into staging Jan 14, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/slack branch January 14, 2026 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants