#12199: fix(message): add threadId parameter to fetch schema for Slack thread reading
agents
stale
Cluster:
Discord Message Enhancements
## Problem
The message tool could send messages to Slack threads but couldn't read thread replies.
When calling:
```javascript
message(action='read', channel='slack', target='<channel>', threadId='<ts>', limit=10)
```
The tool would return channel messages instead of thread replies.
## Root Cause
The `threadId` parameter was only defined in `buildSendSchema()` (for sending to threads) but not in `buildFetchSchema()` (for reading messages).
The backend Slack implementation (`src/slack/actions.ts`) has always supported thread reading via the `conversations.replies` API - the parameter just wasn't exposed in the tool schema.
## Solution
Added `threadId: Type.Optional(Type.String())` to `buildFetchSchema()` in `src/agents/tools/message-tool.ts`.
## Testing
Direct API verification confirmed the backend implementation works correctly when the parameter is provided.
## Files Changed
- `src/agents/tools/message-tool.ts` - Added threadId to buildFetchSchema()
## Impact
- Enables full thread reading for Slack
- Matches existing thread sending capability
- No breaking changes - parameter is optional
- Works with existing backend implementation
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Adds an optional `threadId` parameter to the message tool’s fetch/read schema (`src/agents/tools/message-tool.ts`) so callers can request Slack thread replies when using the existing backend support for `conversations.replies`.
This change aligns the read schema with the already-supported send-to-thread behavior, without altering runtime execution logic (only schema exposure).
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is a narrow schema-only addition (`threadId` optional) that matches existing send schema and does not affect execution flow; no conflicting properties or type issues were introduced in the modified file.
- src/agents/tools/message-tool.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#6071: fix(cli): add --thread-id option to message read command
by lyra63237 · 2026-02-01
85.1%
#14720: fix(slack): pass threadId in plugin read action (#14706)
by lailoo · 2026-02-12
84.0%
#6509: fix(slack): pass threadId param in read action
by morningstar-daemon · 2026-02-01
82.2%
#22216: fix(slack): enable thread reply reading in slack extension plugin
by lan17 · 2026-02-20
82.1%
#2917: Slack: fix thread context + prevent reply spillover
by SocialNerd42069 · 2026-01-27
81.4%
#5098: fix(slack): forward threadId for message.read
by galligan · 2026-01-31
81.1%
#4749: fix: handle string thread IDs in queue drain for Slack
by nvonpentz · 2026-01-30
79.8%
#22485: fix(slack): use threadId from delivery context as threadTs fallback...
by dorukardahan · 2026-02-21
79.4%
#9181: feat(slack): add per-channel thread config override
by halbotley · 2026-02-05
78.9%
#20406: fix(slack): respect replyToMode when computing statusThreadTs in DMs
by QuinnYates · 2026-02-18
78.8%