Skip to content

feat: add activity_unreads and activity_mark_read tools#229

Open
jonzarecki wants to merge 1 commit intokorotovsky:masterfrom
jonzarecki:feat/activity-tools
Open

feat: add activity_unreads and activity_mark_read tools#229
jonzarecki wants to merge 1 commit intokorotovsky:masterfrom
jonzarecki:feat/activity-tools

Conversation

@jonzarecki
Copy link
Copy Markdown

Summary

Two new tools for managing Slack Activity panel unreads:

  • activity_unreads — Returns unread Activity items (thread subscriptions and @mentions) via Slack's activity.feed API (mode: priority_unreads_v1). Matches the Activity panel's Unreads tab exactly — zero false positives. Supports include_messages mode that fetches only unread replies per thread using min_unread_ts as the oldest boundary.

  • activity_mark_read — Marks Activity items as read via activity.markRead API. Accepts key, feed_ts, and type from activity_unreads output. Clears items from the Activity panel.

Motivation

After conversations_unreads + conversations_mark clear channel-level unreads, the Activity panel still shows unread thread replies and @mentions. These are tracked by a separate system and can't be cleared by conversations.mark. This PR closes that gap — enabling true "inbox zero" workflows.

Design

Both tools require browser session tokens (xoxc/xoxd). They are not registered for OAuth (xoxp) or bot (xoxb) tokens — guarded by !IsBotToken() && !IsOAuth().

The diff is purely additive — 612 insertions, 0 deletions. No changes to existing tools or behavior.

File Change
pkg/handler/activity.go NEW — handler with ActivityUnreadsHandler and ActivityMarkReadHandler
pkg/handler/activity_test.go NEW — unit tests for CSV output, item filtering, field extraction, nil safety
pkg/provider/edge/client.go Added ActivityFeed + ActivityMarkRead types and methods
pkg/provider/api.go Added 2 methods to SlackAPI interface + wrappers
pkg/server/server.go Registered both tools (guarded) + 2 constants
pkg/server/server_test.go Added tool names to ValidToolNames assertions
README.md Documented both tools

Token Compatibility

Token activity_unreads activity_mark_read
xoxc/xoxd Tested, works Tested, works
xoxp Not registered (guard) Not registered (guard)
xoxb Not registered (guard) Not registered (guard)

The activity.feed and activity.markRead endpoints are undocumented browser-session APIs — they reject non-xoxc tokens with not_allowed_token_type, similar to client.counts.

Status: Draft — Testing & Feedback Welcome

I'm actively using this in my daily workflow and haven't hit issues so far. Opening as draft to get your feedback on the approach while I continue validating. Specifically interested in your thoughts on:

  1. Tool namingactivity_unreads / activity_mark_read vs alternatives
  2. Handler structure — separate activity.go file vs adding to conversations.go
  3. Edge API types — the activity.feed response types are based on observed Slack client behavior; happy to adjust if you've seen different response shapes
  4. Test coverage — unit tests cover CSV output, filtering, and nil safety. Integration tests would need xoxc/xoxd tokens in CI; happy to add if there's a path for that

No rush on review — will update based on feedback and convert to ready when stable.

Made with Cursor

Two new tools for managing Slack Activity panel unreads:

- activity_unreads: Returns unread Activity items (thread subscriptions
  and @mentions) via Slack's activity.feed API (mode: priority_unreads_v1).
  Matches the Activity panel's Unreads tab exactly — zero false positives.
  Supports include_messages mode that fetches only unread replies per
  thread using min_unread_ts as the oldest boundary.

- activity_mark_read: Marks Activity items as read via activity.markRead
  API. Accepts key, feed_ts, and type from activity_unreads output.
  Clears items from the Activity panel.

Both tools require browser session tokens (xoxc/xoxd) and are not
registered for OAuth (xoxp) or bot (xoxb) tokens.

No changes to existing tools or behavior. Purely additive diff.

Made-with: Cursor
@jonzarecki jonzarecki marked this pull request as ready for review March 15, 2026 14:18
jonzarecki added a commit to jonzarecki/slack-mcp-server that referenced this pull request Mar 15, 2026
The README had documentation for activity_unreads and activity_mark_read
which belong to the separate feat/activity-tools branch (PR korotovsky#229).
Renumber saved-items tools to 16-18.

Made-with: Cursor
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.

1 participant