Skip to main content

Module slack

Module slack 

Source
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 - the SlackFacade seam (prod over Weak<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 🔒
AttachmentArgs 🔒
Bookmarks 🔒
BookmarksArgs 🔒
ChannelWatchArg 🔒
Edit 🔒
EditArgs 🔒
History 🔒
HistoryArgs 🔒
List 🔒
ListArgs 🔒
Me 🔒
MeArgs 🔒
Pins 🔒
PinsArgs 🔒
Post 🔒
PostArgs 🔒
React 🔒
ReactArgs 🔒
Replies 🔒
RepliesArgs 🔒
Search 🔒
SearchArgs 🔒
Subscribe 🔒
SubscribeArgs 🔒
Unsubscribe 🔒
UnsubscribeArgs 🔒
User 🔒
UserArgs 🔒
Users 🔒
UsersArgs 🔒

Enums§

WatchModeArg 🔒
The mode a caller writes in a slack__subscribe argument.

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__search when the caller does not cap them.
LIST_KINDS 🔒
The kinds kind accepts, matching what each row reports.
MAX_HISTORY_LIMIT 🔒
Slack’s own ceiling for one conversations.history page.
MAX_REPLIES_LIMIT 🔒
Slack’s own ceiling for one conversations.replies page.

Functions§

add_tools 🔒
Attach the Slack tools to an existing McpServerBuilder. Called for BOTH lead and worker sessions (any-caller), so build_forge_server invokes this unconditionally. subscribe / unsubscribe are 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__unsubscribe accepts. 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 subscribed and listing the caller’s own subscription ids that cover it.
message_row 🔒
One message as both read tools report it. files keeps 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__unsubscribe accepts), 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; name is absent until the sweep’s directory walk has seen the conversation.
tool_error 🔒