Expand description
Slack MCP - read the conversations the caller’s workspace offers
(mcp__forge__slack__*).
No tool takes a workspace argument: the calling session’s slot names
its project, and forge.toml’s org or project binding names that
project’s workspace. slack__list lists every conversation in it and
marks which ones the caller has subscribed; slack__subscribe and
slack__unsubscribe manage those records. A subscription is live: the
per-workspace poll pump sweeps it and delivers matches into the
owning session.
facade- theSlackFacadeseam (prod overWeak<Workspace>+ a mock for tool tests).
Re-exports§
use std::sync::Arc;🔒use forge_connectors::slack::SlackHistoryMessage;🔒use forge_primitives::slack::SlackConversation;🔒use forge_primitives::slack::SlackSubscription;🔒use forge_primitives::slack::SlackSubscriptionTarget;🔒use forge_primitives::slack::SlackWatchMode;🔒use forge_sdk::mcp::server::McpServerBuilder;🔒use forge_sdk::mcp::tool::Tool;🔒use forge_sdk::mcp::tool::ToolInput;🔒use forge_sdk::mcp::tool::ToolOutput;🔒use uuid::Uuid;🔒use crate::SessionSlot;🔒use crate::mcp::slack::facade::SlackAttachmentError;🔒use crate::mcp::slack::facade::SlackChannelWatch;🔒use crate::mcp::slack::facade::SlackEditError;🔒use crate::mcp::slack::facade::SlackEditRequest;🔒use crate::mcp::slack::facade::SlackFacade;🔒use crate::mcp::slack::facade::SlackFetchRequest;🔒use crate::mcp::slack::facade::SlackPostError;🔒use crate::mcp::slack::facade::SlackPostRequest;🔒use crate::mcp::slack::facade::SlackReactError;🔒use crate::mcp::slack::facade::SlackReactRequest;🔒use crate::mcp::slack::facade::SlackReadError;🔒use crate::mcp::slack::facade::SlackSubscribeError;🔒use crate::mcp::slack::facade::SlackSubscribeRequest;🔒use crate::mcp::slack::facade::SlackUnsubscribeError;🔒use crate::mcp::slack::facade::SlackUploadRequest;🔒use crate::mcp::slack::facade::format_workspace_error;🔒
Modules§
- facade 🔒
SlackFacade- the seam between the Slack MCP tools and workspace state. The production impl (ProdSlackFacade) resolves the caller’s workspace from its project’s config binding and drives that workspace’s client; the mock returns preloaded results so the tool tests can assert argument handling and error surfacing without a real workspace.
Structs§
- Attachment 🔒
- Attachment
Args 🔒 - Bookmarks 🔒
- Bookmarks
Args 🔒 - Channel
Watch 🔒Arg - Edit 🔒
- Edit
Args 🔒 - History 🔒
- History
Args 🔒 - List 🔒
- List
Args 🔒 - Me 🔒
- MeArgs 🔒
- Pins 🔒
- Pins
Args 🔒 - Post 🔒
- Post
Args 🔒 - React 🔒
- React
Args 🔒 - Replies 🔒
- Replies
Args 🔒 - Search 🔒
- Search
Args 🔒 - Subscribe 🔒
- Subscribe
Args 🔒 - Unsubscribe 🔒
- Unsubscribe
Args 🔒 - User 🔒
- User
Args 🔒 - Users 🔒
- Users
Args 🔒
Enums§
- Watch
Mode 🔒Arg - The mode a caller writes in a
slack__subscribeargument.
Constants§
- DEFAULT_
HISTORY_ 🔒LIMIT - Messages per read when the caller does not cap them.
- DEFAULT_
REPLIES_ 🔒LIMIT - Replies per thread read when the caller does not cap them.
- DEFAULT_
SEARCH_ 🔒COUNT - Results per
slack__searchwhen the caller does not cap them. - LIST_
KINDS 🔒 - The kinds
kindaccepts, matching what each row reports. - MAX_
HISTORY_ 🔒LIMIT - Slack’s own ceiling for one
conversations.historypage. - MAX_
REPLIES_ 🔒LIMIT - Slack’s own ceiling for one
conversations.repliespage.
Functions§
- add_
tools 🔒 - Attach the Slack tools to an existing
McpServerBuilder. Called for BOTH lead and worker sessions (any-caller), sobuild_forge_serverinvokes this unconditionally.subscribe/unsubscribeare scoped to the caller’s own records, so they need the caller slot. - class_
subscriptions 🔒 - The caller’s own class subscriptions - the DM class and the mention
target. Neither covers one conversation, so no row can carry them, and
their ids are the only handle
slack__unsubscribeaccepts. The target names match the ones the Inspector’s SLACK section shows. - conversation_
kind 🔒 - conversation_
name 🔒 - The conversation’s name, or the DM partner’s user id when Slack omits one - a DM’s display name is otherwise empty.
- covering_
subscription_ 🔒ids - The caller’s subscription ids that cover
conversation- after a restart these are the only handle a session has to unsubscribe with. - format_
attachment_ 🔒error - format_
edit_ 🔒error - format_
post_ 🔒error - format_
react_ 🔒error - format_
read_ 🔒error - format_
subscribe_ 🔒error - is_
subscribed 🔒 - A conversation is watched when a target names its id, or - for a DM or group DM - when the caller watches the whole DM class.
- list_
rows 🔒 - One row per conversation, marking the ones in
subscribedand listing the caller’s own subscription ids that cover it. - message_
row 🔒 - One message as both read tools report it.
fileskeeps the ids an attachment fetch takes; the file’s bearer URL never leaves the connector. - passes_
filter 🔒 - Whether one conversation passes
slack__list’s optional filters: a case-insensitive substring over the display name, purpose and topic, and an exact kind match. - read_
rows 🔒 - sent_
back_ 🔒refusal - What a blocked call reads when the reader sends its draft back. The note is the reader’s own words and stays whole; the fixed halves say what did not happen and what the agent is expected to do next.
- sub_
to_ 🔒row - One subscription as a tool-result row: its id (the only handle
slack__unsubscribeaccepts), the workspace it watches, and its target in a shape a reader can switch on. - target_
to_ 🔒json - The subscription target’s tool-output spelling. The durable enum’s own
serde form is externally tagged and unreadable (
"DirectMessages", or{"Conversation": {..}}), so results carry this instead;nameis absent until the sweep’s directory walk has seen the conversation. - tool_
error 🔒