Skip to content

feat(slack): add read_slack_history MCP tool - #18748

Closed
iamwhatever wants to merge 1 commit into
mainfrom
replace/7930-read-slack-history
Closed

iamwhatever wants to merge 1 commit into
mainfrom
replace/7930-read-slack-history

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Give agents a read_slack_history tool so they can read a human's reply in a Slack channel or thread, closing the send-only gap in the Slack tool surface.

Kiro Crew agents can send Slack messages (send_message) and read a user's
profile (read_slack_profile), but there is no tool to read Slack channel or
thread history
. An agent can push messages out but cannot see a human's reply,
so any "act on a Slack reply" workflow (a human approves in a thread, an agent
picks it up) has to fall back to the dashboard chat channel.

The optional Slack MCP server (get_thread) can read threads, but it reads with
a per-user OAuth token the operator must register first, and it is scoped to
everything that user can see. An unattended cron agent on an install without
that OAuth setup has no read path at all. This tool reads with the bot token
the install already has, and only from the operator's tracked channels.

Why it matters

Reading conversation context is a basic building block for Slack-driven
automation. Without it, approval loops and reply-triggered workflows cannot be
built on Slack at all. Adding read_slack_history makes the messaging tool
surface symmetric (send + read) and unlocks those workflows.

Not a goal

  • Owner-DM reads are out of scope. Reads are restricted to the operator's
    tracked-channel allowlist. Whether an agent may read the owner's DMs (the
    DM-approval case) is a broader authorization decision deferred to a maintainer
    follow-up, not absorbed here.
  • No new Slack scopes, no UI surface, and no change to any existing tool.

What changed (motivation → approach → change)

Goal: let an agent read recent Slack messages. Approach: mirror the existing
read_slack_profile tool (MCP tool → gateway route → Slack client call), and
reuse the established tracked-channel authorization that api_slack_pins /
api_slack_reactions already apply, rather than inventing a new policy. Change:

  • MCP tool (mcp_tools/messaging.py): new read_slack_history schema and
    handler, registered in HANDLERS; POSTs to a new gateway route.
  • Gateway route (dashboard/handlers/messaging.py): api_slack_history,
    mirroring api_slack_profile, calling fetch_channel_history /
    fetch_thread_history.
  • Slack client (slack/client.py): fetch_channel_history and
    fetch_thread_history (pages a thread to the end and keeps the newest
    limit replies). Neither swallows errors: SlackApiError surfaces as
    missing_scope / channel_not_found, and a network or timeout error reaches
    the route's 502 slack_api_error, so a polling caller never reads a blip as
    "no reply yet". oldest is sent with inclusive=True, matching the tool's
    "at or after" wording.
  • Route registration + strict-internal-API-paths entry (MCP-only, no browser caller).
  • Message text redacted (credentials + exfiltration URLs) before return; every
    error response carries a machine-readable code.
  • Each message carries admitted, true only when the inbound Slack gate
    (is_allowed_user) admits its sender, and the tool tells the agent to trust a
    reply as an approval only when it is true. All bot messages are dropped unless
    include_bot is set.
  • docs/architecture/mcp.md lists the new tool and its gates.

Authorization — tracked channels only. api_slack_history applies the same
deny-by-default is_tracked_channel allowlist as the other channel-reading
routes, so it grants no read access beyond what the existing Slack tools have.

Containment. read_slack_history is added to CHANNEL_AGENT_BLOCKED_TOOLS
for the same exfiltration reason as session_read_message.

Validation. A ToolSchema for the args is registered in MCP_CORE_SCHEMAS
and is the only MCP-side check (the handler reads the validated args; the route
re-checks them);
an mcp_tool_titles.json entry is added. Per #7237 the two new CHANNEL_ID_RE
checks are capped with CHANNEL_MAX_LEN.

Backwards compatibility

Compatible: this is purely additive — a new tool, a new route, a new Slack-client
method. No existing field, validator, type, or route is rejected, renamed, or
removed, and no existing behaviour changes.

Tests

  • test/test_send_message_targeted.py — TestSlackHistory (timeline, thread,
    tracked-channel deny-by-default 403, missing channel/format 400, not connected
    503, missing scope 403, network error 502, admitted only for the admitted
    sender) + TestReadSlackHistoryMcpTool
    (schema + handler registered) + TestReadSlackHistorySchema (schema refuses
    bad args) + TestRealSlackClientHistory (fake _web: two cursor pages keep
    the newest replies, SlackApiError and timeouts raise, oldest is inclusive).
  • test/test_dashboard_server_composition_contract.py — MCP route-table rows
    and digest recomputed from the test after the rebase.
  • test/test_handlers_messaging_composition_contract.py — re-export count bumped
    for the new api_slack_history facade name.
  • test/test_error_code_contract.py — passes: every new error site carries a code.
  • Local gates green on changed files: black, isort, flake8, pytest.

Credit

Reworked from @Patcurley1's fork PR onto current main (the original had drifted
behind and conflicted). Original author credited via Co-authored-by.

Replaces #7930
Fixes #18747

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 10, 2026 06:30
@iamwhatever

Copy link
Copy Markdown
Contributor Author

@Patcurley1 — thanks for this! I've reworked it onto current main as #18748 (the fork branch had drifted ~3.3k commits behind and conflicted). Your authorship is preserved via Co-authored-by.

One posture change to flag: the reviewers blocked on the handler having only a channel-ID-format check and no authorization. I've applied the tracked-channels-only allowlist (is_tracked_channel, same as api_slack_pins/api_slack_reactions). That means owner-DM reads are NOT included — which is the DM-approval use case your description motivated. I left that out deliberately: whether an agent may read the owner's DMs is a broader authorization decision for a maintainer, and I didn't want to self-decide it. If you'd like the DM path, it'd be worth raising as its own follow-up so it gets an explicit maintainer sign-off.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 2cd046f3bb6af1ae2dd45ab877b7762647bc6f12 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 2cd046f3bb6af1ae2dd45ab877b7762647bc6f12 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check before merge: fetch_thread_history is a second conversations.replies reader next to fetch_thread_replies. It is kept separate only because it raises errors and pages through the thread.

What this change ships

Inventory (8 items) — 8 justified

Intent: let an agent see a human's Slack reply in a tracked channel or thread, using the bot token the install already has. This is an ADDITION (Fixes #18747).

  1. Agents get a read_slack_history tool for a tracked channel's timeline or a single thread — justified
  2. Reading a channel the operator has not tracked is refused with 403 — justified
  3. A channel-bound agent is refused the tool at dispatch, and it is added to CHANNEL_AGENT_BLOCKED_TOOLS — justified
  4. Each message is marked admitted only when the inbound Slack gate admits its sender — justified
  5. Bot messages are hidden by default; the include_bot argument shows them — justified
  6. limit and an inclusive oldest bound let a poller read only what is new — justified
  7. Thread reads page through to the end and keep the newest replies; Slack and network errors are surfaced, not returned as an empty list — justified
  8. Message text has credentials and exfiltration URLs redacted, and every error carries a code — justified

[FIRST-PRINCIPLES-REVIEWED] 2cd046f

Description read

[DESCRIPTION-READ] 7d070cb79ca8b928a53a214680e7fe0a07f707f29d2c75abb11e52027235da98

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

Design-level review of 2cd046f3bb6af1ae2dd45ab877b7762647bc6f12 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Messages from people the Slack gate does not admit reach unattended agents as plain text, with nothing marking them as untrusted.

Watch

  • Non-admitted text comes back unframed. read_slack_history returns {user, text, ts, admitted} for every human in a tracked channel. Its description says to "Trust a reply as an approval only when admitted is true", but it never says that other messages are untrusted input and must not be followed as instructions. Redaction covers credentials and exfiltration URLs only. As a result, a channel member who is not the owner can put instructions into a cron agent's context. That agent is not channel-bound, so CHANNEL_AGENT_BLOCKED_TOOLS does not stop it, and it can act on those instructions with its full toolset, including send_message. The fix is small: drop or blank the text of non-admitted messages by default (an opt-in flag can return it), or wrap it in the repo's existing untrusted third-party text framing, as mcp_tools/skills.py does.
    Clears when: non-admitted message text is either withheld by default or returned inside an explicit untrusted-content frame, with a test that pins it.

[DESIGN-REVIEWED] 2cd046f

Description read

[DESCRIPTION-READ] 5214a043cb5669704659b867faa721c205393a4f8a398756f4a2409735ea9f62

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@iamwhatever
iamwhatever force-pushed the replace/7930-read-slack-history branch from c278969 to 483a40b Compare October 10, 2026 06:40
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 2cd046f3bb6af1ae2dd45ab877b7762647bc6f12 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 2cd046f

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 2cd046f3bb6af1ae2dd45ab877b7762647bc6f12: <one-sentence reason>

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 10, 2026
@iamwhatever
iamwhatever force-pushed the replace/7930-read-slack-history branch from 483a40b to 0a247d3 Compare October 10, 2026 06:53
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 2cd046f3bb6af1ae2dd45ab877b7762647bc6f12 — this comment is updated in place on each push.

Review details

No findings block the merge.

FINDING — src/kiro_crew/dashboard/handlers/messaging.py:1618 — the bot-message filter runs only after limit has already cut the raw list (collected[-limit:] at slack/client.py:1072, and Slack's own limit in fetch_channel_history). So when the bot posts limit or more messages after a human's reply (20 by default), the read returns {"messages": []}, and a poller waiting for an approval sees "no reply yet" → Fix: in fetch_thread_history, filter out bot messages before taking [-limit:] (it already pages the whole thread). On the channel path, fetch more than limit and truncate after filtering.

[OPUS-REVIEWED] 2cd046f

Verdict parsed from the review's SHA-scoped output markers for commit 2cd046f3bb6af1ae2dd45ab877b7762647bc6f12.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 2cd046f3bb6af1ae2dd45ab877b7762647bc6f12: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 10, 2026
@iamwhatever
iamwhatever force-pushed the replace/7930-read-slack-history branch from 0a247d3 to b62985f Compare October 10, 2026 07:20
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 10, 2026
@iamwhatever
iamwhatever force-pushed the replace/7930-read-slack-history branch 2 times, most recently from c1c34e6 to 959ceff Compare October 10, 2026 08:02
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Oct 10, 2026
@iamwhatever
iamwhatever force-pushed the replace/7930-read-slack-history branch from 959ceff to 515ba95 Compare October 10, 2026 19:16
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 10, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Addressed the CHANGES NEEDED self-review above on head f5724de (rebased onto current main, still one commit, @Patcurley1 kept as author and Co-authored-by). Tracked-channels-only stays; owner-DM reads stay out of scope.

  1. DM wording — removed from the tool description, the channel field description and the feature-map row. They now say a tracked channel, e.g. C0123ABC456.
  2. oldest "at or after" — both fetch_channel_history and fetch_thread_history now send inclusive=True with oldest. Test: TestRealSlackClientHistory::test_oldest_is_sent_inclusive.
  3. Network/timeout errors read as an empty list — the aiohttp/timeout catches are gone from both methods, so the error reaches the route's 502 slack_api_error branch. Tests: test_network_errors_raise_not_empty (both methods) and TestSlackHistoryNetworkError::test_network_error_returns_502 (real client, fake _web).
  4. No client-level test for thread paging / SlackApiError — added test_thread_paging_keeps_newest_replies (two cursor pages, limit=2 keeps 4.0, 5.0, second call carries the cursor) and test_thread_slack_api_error_propagates.
  5. First Principles item 6 (handler re-validates schema args) — deleted the hand-rolled channel / limit / thread_ts / oldest checks; the handler now reads the args _validate_args already checked, and the route still re-checks them. TestReadSlackHistorySchema shows the schema refuses each bad input. First Principles item 7 is the same fix as point 1. The Opus finding is the same fix as point 2.

Conflict: only the MCP route-table contract test; rows and digest recomputed from the test (275 rows). The four behavior tests fail on the old client code and pass now. PR body updated to match.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 11, 2026
@iamwhatever
iamwhatever force-pushed the replace/7930-read-slack-history branch from f5724de to 72e51d9 Compare October 11, 2026 08:30
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Follow-up on the lane comments for f5724de, fixed in 72e51d9 (still one commit):

  • Opus: bot filter drops every bot, docs say "the bot's own" — the tool, include_bot and route descriptions now say all bot messages are excluded by default (behavior unchanged).
  • Opus: docs/architecture/mcp.md tool list — read_slack_history added with its tracked-channel / channel-agent / admitted gates.
  • Design: no sender admission check — each message now carries admitted (is_allowed_user(user), the inbound gate's check), and the tool description tells the agent to trust a reply as an approval only when admitted is true. Test: TestSlackHistoryAdmitted.
  • First Principles item 1: Slack MCP server overlap — the PR body now names the difference: that server needs per-user OAuth and reads everything that user sees; this tool uses the existing bot token and only tracked channels.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 11, 2026
Adds a read_slack_history MCP tool so an agent can read recent messages
from a Slack channel/DM the bot is a member of (e.g. to pick up a human's
reply in an approval thread), mirroring the existing read_slack_profile
pattern so the messaging tool surface is symmetric (send + read).

- mcp_tools/messaging.py: read_slack_history tool schema + handler, registered
  in HANDLERS; POSTs to a new gateway route like read_slack_profile does.
- dashboard/handlers/messaging.py: api_slack_history, mirroring api_slack_profile,
  calling conversations_history / fetch_thread_replies.
- slack/client.py: fetch_channel_history (does not swallow SlackApiError so
  missing_scope / channel_not_found surface to the caller).
- Route registration + strict-internal-API-paths entry (MCP-only, no browser caller).
- Message text is redacted (credentials + exfiltration URLs) before return.

Authorization (tracked channels only): api_slack_history applies the same
deny-by-default is_tracked_channel allowlist as api_slack_pins /
api_slack_reactions, so it grants no read access beyond what the existing
Slack tools already have. Owner-DM reads are deliberately NOT included — that
is a separate, broader authorization decision left to a maintainer follow-up.

Containment: read_slack_history is added to CHANNEL_AGENT_BLOCKED_TOOLS for the
same exfiltration reason as session_read_message — a channel-bound agent must
not pull one tracked channel's conversation into another thread.

Validation: a ToolSchema for the tool's arguments is registered in
MCP_CORE_SCHEMAS, and an mcp_tool_titles.json entry is added.

Per #7237, the two new CHANNEL_ID_RE checks are capped with CHANNEL_MAX_LEN.

Replaces #7930 (fork PR). Co-authored with the original author.

Co-authored-by: Patcurley1 <101998702+Patcurley1@users.noreply.github.com>
@iamwhatever
iamwhatever force-pushed the replace/7930-read-slack-history branch from 72e51d9 to 2cd046f Compare October 11, 2026 09:04
@iamwhatever

Copy link
Copy Markdown
Contributor Author

GPT 6.1 findings on 72e51d9, fixed in 2cd046f (still one commit). Each has a test that fails on the old code.

  • BLOCKING messaging.py:1491 non-object JSON → 500 — api_slack_history now reads its body with read_bounded_json, so null / [] get a 400 before any field access (cap row added to test_json_object_body_guard.py).
  • include_bot: "false" turns bot messages on — the route now refuses a non-boolean include_bot with 400; only JSON true enables it. The route also checks thread_ts / oldest against the Slack ts pattern itself, since the MCP schema does not run on a direct POST. Test: TestSlackHistoryDirectRequestShape.
  • client.py:1048 paging cap returns older replies as newest — fetch_thread_history now raises when a cursor is still left after _THREAD_HISTORY_MAX_PAGES pages (the route maps it to 502). Test: test_thread_past_the_paging_cap_raises.

The Backend Tests (3.12, 4) red on 72e51d9 was test_platform_compat.py::TestProcessArgvMatchesExact, which this PR does not touch.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 11, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Head 2cd046f: every check-run is green, GPT and Opus have no blocking findings, First Principles is PASS. Two advisory items are left open. I did not push for them, so the green head stays put:

  • Design CONCERNS (non-admitted text reaches the agent unframed) — this is the posture question the self-review already handed to the code owner. Should non-admitted text be withheld by default or wrapped in the untrusted-content frame? That is a policy call. The PR keeps the admitted flag and the approval-only-when-admitted wording.
  • Opus (bot filter runs after limit) — this is real. If the bot posts limit or more messages after a human reply, the read can come back empty. The fix is to filter bots before truncating. It can be a follow-up, or one more push if the owner wants it in this PR.

@iamwhatever
iamwhatever marked this pull request as ready for review October 11, 2026 10:00
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Oct 11, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Closing: on reflection this is a new capability (an agent-side pull of Slack history), not a bug fix, and inbound Slack messages already reach the agent as turns via the existing channel gate. Whether agents should gain an on-demand read of channel history — and how replies read this way are treated as untrusted input — is a maintainer product/authorization call. The request stays tracked in #18747; the original contribution is #7930. Thanks @Patcurley1 for the groundwork.

@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 12, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

[operator: bolichen97] Continuing this in #30735; thanks for the start.

bolichen97 added a commit that referenced this pull request Nov 5, 2026
An agent can post to Slack but cannot read what was said back, so a
"wait for the owner to approve in a thread" loop has nowhere to read
the answer. Add a read_slack_history MCP tool: it reads one tracked
channel's timeline, or one thread, with the bot token the install
already holds.

The read adds no new way in. Any channel outside the tracked list is
refused, a channel agent is refused at dispatch, and text comes back
only for messages whose sender the inbound gate admits (the owner).
Anyone else's message is listed with admitted false and no text. Bot
posts are dropped before the limit applies, so a run of them cannot
hide a reply, and a failed Slack read is an error, never an empty list.
Reading the owner's DMs stays out of scope.

Builds on #18748 by @iamwhatever and #7930 by @Patcurley1.

Co-authored-by: Patcurley1 <101998702+Patcurley1@users.noreply.github.com>
bolichen97 added a commit that referenced this pull request Nov 6, 2026
An agent can post to Slack but cannot read what was said back, so a
"wait for the owner to approve in a thread" loop has nowhere to read
the answer. Add a read_slack_history MCP tool: it reads one tracked
channel's timeline, or one thread, with the bot token the install
already holds.

The read adds no new way in. Any channel outside the tracked list is
refused, a channel agent is refused at dispatch, and text comes back
only for messages whose sender the inbound gate admits (the owner).
Anyone else's message is listed with admitted false and no text. Bot
posts are dropped before the limit applies, so a run of them cannot
hide a reply, and a failed Slack read is an error, never an empty list.
Reading the owner's DMs stays out of scope.

Builds on #18748 by @iamwhatever and #7930 by @Patcurley1.

Co-authored-by: Patcurley1 <101998702+Patcurley1@users.noreply.github.com>
bolichen97 added a commit that referenced this pull request Nov 6, 2026
An agent can post to Slack but cannot read what was said back, so a
"wait for the owner to approve in a thread" loop has nowhere to read
the answer. Add a read_slack_history MCP tool: it reads one tracked
channel's timeline, or one thread, with the bot token the install
already holds.

The read adds no new way in. Any channel outside the tracked list is
refused, a channel agent is refused at dispatch, and text comes back
only for messages whose sender the inbound gate admits (the owner).
Anyone else's message is listed with admitted false and no text. Bot
posts are dropped before the limit applies, so a run of them cannot
hide a reply, and a failed Slack read is an error, never an empty list.
Reading the owner's DMs stays out of scope.

Builds on #18748 by @iamwhatever and #7930 by @Patcurley1.

Co-authored-by: Patcurley1 <101998702+Patcurley1@users.noreply.github.com>
bolichen97 added a commit that referenced this pull request Nov 6, 2026
An agent can post to Slack but cannot read what was said back, so a
"wait for the owner to approve in a thread" loop has nowhere to read
the answer. Add a read_slack_history MCP tool: it reads one tracked
channel's timeline, or one thread, with the bot token the install
already holds.

The read adds no new way in. Any channel outside the tracked list is
refused, a channel agent is refused at dispatch, and text comes back
only for messages whose sender the inbound gate admits (the owner).
Anyone else's message is listed with admitted false and no text. Bot
posts are dropped before the limit applies, so a run of them cannot
hide a reply, and a failed Slack read is an error, never an empty list.
Reading the owner's DMs stays out of scope.

Builds on #18748 by @iamwhatever and #7930 by @Patcurley1.

Co-authored-by: Patcurley1 <101998702+Patcurley1@users.noreply.github.com>
bolichen97 added a commit that referenced this pull request Nov 6, 2026
An agent can post to Slack but cannot read what was said back, so a
"wait for the owner to approve in a thread" loop has nowhere to read
the answer. Add a read_slack_history MCP tool: it reads one tracked
channel's timeline, or one thread, with the bot token the install
already holds.

The read adds no new way in. Any channel outside the tracked list is
refused, a channel agent is refused at dispatch, and text comes back
only for messages whose sender the inbound gate admits (the owner).
Anyone else's message is listed with admitted false and no text. Bot
posts are dropped before the limit applies, so a run of them cannot
hide a reply, and a failed Slack read is an error, never an empty list.
Reading the owner's DMs stays out of scope.

Builds on #18748 by @iamwhatever and #7930 by @Patcurley1.

Co-authored-by: Patcurley1 <101998702+Patcurley1@users.noreply.github.com>
bolichen97 added a commit that referenced this pull request Nov 6, 2026
An agent can post to Slack but cannot read what was said back, so a
"wait for the owner to approve in a thread" loop has nowhere to read
the answer. Add a read_slack_history MCP tool: it reads one tracked
channel's timeline, or one thread, with the bot token the install
already holds.

The read adds no new way in. Any channel outside the tracked list is
refused, a channel agent is refused at dispatch, and text comes back
only for messages whose sender the inbound gate admits (the owner).
Anyone else's message is listed with admitted false and no text. Bot
posts are dropped before the limit applies, so a run of them cannot
hide a reply, and a failed Slack read is an error, never an empty list.
Reading the owner's DMs stays out of scope.

Builds on #18748 by @iamwhatever and #7930 by @Patcurley1.

Co-authored-by: Patcurley1 <101998702+Patcurley1@users.noreply.github.com>
bolichen97 added a commit that referenced this pull request Nov 6, 2026
An agent can post to Slack but cannot read what was said back, so a
"wait for the owner to approve in a thread" loop has nowhere to read
the answer. Add a read_slack_history MCP tool: it reads one tracked
channel's timeline, or one thread, with the bot token the install
already holds.

The read adds no new way in. Any channel outside the tracked list is
refused, a channel agent is refused at dispatch, and text comes back
only for messages whose sender the inbound gate admits (the owner).
Anyone else's message is listed with admitted false and no text. Bot
posts are dropped before the limit applies, so a run of them cannot
hide a reply, and a failed Slack read is an error, never an empty list.
Reading the owner's DMs stays out of scope.

Builds on #18748 by @iamwhatever and #7930 by @Patcurley1.

Co-authored-by: Patcurley1 <101998702+Patcurley1@users.noreply.github.com>
bolichen97 added a commit that referenced this pull request Nov 7, 2026
An agent can post to Slack but cannot read what was said back, so a
"wait for the owner to approve in a thread" loop has nowhere to read
the answer. Add a read_slack_history MCP tool: it reads one tracked
channel's timeline, or one thread, with the bot token the install
already holds.

The read adds no new way in. Any channel outside the tracked list is
refused, a channel agent is refused at dispatch, and text comes back
only for messages whose sender the inbound gate admits (the owner).
Anyone else's message is listed with admitted false and no text. Bot
posts are dropped before the limit applies, so a run of them cannot
hide a reply, and a failed Slack read is an error, never an empty list.
Reading the owner's DMs stays out of scope.

Builds on #18748 by @iamwhatever and #7930 by @Patcurley1.

Co-authored-by: Patcurley1 <101998702+Patcurley1@users.noreply.github.com>
KiroCrewCaptain pushed a commit that referenced this pull request Nov 7, 2026
…30735)

An agent can post to Slack but cannot read what was said back, so a
"wait for the owner to approve in a thread" loop has nowhere to read
the answer. Add a read_slack_history MCP tool: it reads one tracked
channel's timeline, or one thread, with the bot token the install
already holds.

The read adds no new way in. Any channel outside the tracked list is
refused, a channel agent is refused at dispatch, and text comes back
only for messages whose sender the inbound gate admits (the owner).
Anyone else's message is listed with admitted false and no text. Bot
posts are dropped before the limit applies, so a run of them cannot
hide a reply, and a failed Slack read is an error, never an empty list.
Reading the owner's DMs stays out of scope.

Builds on #18748 by @iamwhatever and #7930 by @Patcurley1.

Co-authored-by: Patcurley1 <101998702+Patcurley1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(slack): add a read_slack_history MCP tool so agents can read channel/thread replies

3 participants