You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add thread reply support with optional thread-ts parameter (#10)
* Initial plan
* Add reply-message functionality for threading support
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Fix code formatting for consistency
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Refactor to use optional timestamp parameter on send-message
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Rename parameter to [thread-ts] and clarify it's for replying to threads
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Print thread-ts after sending messages for thread continuity
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
* Only print thread-ts for new messages, not thread replies
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@ Add this to your prompt (e.g. `AGENTS.md`):
36
36
37
37
```markdown
38
38
- You can send messages to a Slack user by using the `slack send-message <channel|email> "<message>"` command.
39
+
- You can reply to a message in a thread by adding the thread timestamp as a third parameter: `slack send-message <channel|email> "<message>" <thread-ts>`.
39
40
- The message supports Markdown formatting which will be automatically converted to Slack's Mrkdwn format.
40
41
- For AI assistants supporting MCP (Model Context Protocol), you can use `slack mcp-server` to enable tool-based Slack integration.
41
42
```
@@ -46,16 +47,27 @@ Add this to your prompt (e.g. `AGENTS.md`):
46
47
47
48
```bash
48
49
Usage:
49
-
slack configure - configure Slack token (reads from stdin)
50
-
slack send-message <channel|email><message>- send a message to a user
51
-
slack mcp-server - start MCP server (Model Context Protocol)
50
+
slack configure - configure Slack token (reads from stdin)
51
+
slack send-message <channel|email><message>[thread-ts] - send a message (optionally reply to a thread)
52
+
slack mcp-server - start MCP server (Model Context Protocol)
52
53
```
53
54
54
-
**Example:**
55
+
**Examples:**
55
56
```bash
57
+
# Send a message (prints thread-ts for starting a thread)
56
58
slack send-message alex_collins@intuit.com "I love this tool! It makes Slack integration so easy."
59
+
# Output:
60
+
# Message sent to alex_collins@intuit.com (U12345678)
61
+
# thread-ts: 1234567890.123456
62
+
63
+
# Reply to a message in a thread (use the thread-ts from the previous message)
64
+
slack send-message alex_collins@intuit.com "Thanks for the feedback!""1234567890.123456"
65
+
# Output:
66
+
# Reply sent to alex_collins@intuit.com (U12345678) in thread 1234567890.123456
57
67
```
58
68
69
+
The `thread-ts` is only printed when sending a new message (not when replying to a thread), allowing you to use it to start a threaded conversation.
70
+
59
71
### MCP Server Mode
60
72
61
73
The MCP (Model Context Protocol) server allows AI assistants and other tools to interact with Slack through a standardized JSON-RPC protocol over stdio. This enables seamless integration with AI coding assistants and other automation tools.
@@ -79,9 +91,11 @@ The MCP (Model Context Protocol) server allows AI assistants and other tools to
79
91
}
80
92
```
81
93
82
-
The server exposes a`send_message` tool that accepts:
94
+
The server exposes the`send_message` tool with the following parameters:
83
95
-`identifier` - Slack channel ID (e.g., 'C1234567890') or user email address (e.g., 'user@example.com')
84
96
-`message` - The message to send (supports Markdown formatting)
97
+
-`thread_ts` - Optional: The thread timestamp of the parent message to reply to (e.g., '1234567890.123456'). When provided, the message will be sent as a threaded reply.
85
98
86
99
**Example usage from an AI assistant:**
87
100
> "Slack alex_collins@intuit.com to say how much you like this tool."
101
+
> "Reply to that Slack message with a thumbs up emoji."
mcp.WithDescription("Send a message to a Slack channel or user. You can specify either a channel ID or a user's email address. The message supports Markdown formatting which will be automatically converted to Slack's Mrkdwn format."),
33
+
mcp.WithDescription("Send a message to a Slack channel or user. You can specify either a channel ID or a user's email address. The message supports Markdown formatting which will be automatically converted to Slack's Mrkdwn format. Optionally provide a thread_ts to reply to a message in a thread."),
34
34
mcp.WithString("identifier",
35
35
mcp.Required(),
36
36
mcp.Description("The Slack channel ID (e.g., 'C1234567890') or user email address (e.g., 'user@example.com')"),
mcp.Description("The message to send. Supports Markdown formatting."),
41
41
),
42
+
mcp.WithString("thread_ts",
43
+
mcp.Description("Optional: The thread timestamp of the parent message to reply to (e.g., '1234567890.123456'). When provided, the message will be sent as a threaded reply."),
0 commit comments