send_announcement
Send formatted announcements to Slack channels, including a title, message, and optional details like author, timestamp, or thread replies. Simplify team communication with structured updates.
Instructions
Send a formatted announcement message.
Args: channel: Channel ID or name title: Announcement title message: Main announcement message author: Author name (optional) timestamp: Custom timestamp (optional) thread_ts: Thread timestamp for replies (optional)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| author | No | ||
| channel | Yes | ||
| message | Yes | ||
| thread_ts | No | ||
| timestamp | No | ||
| title | Yes |
Implementation Reference
- slack_mcp/server.py:1031-1076 (handler)The main handler function for the 'send_announcement' MCP tool. It is registered via the @mcp.tool() decorator. Constructs a Block Kit formatted announcement message with header, section, and context elements, then sends it using SlackClient.send_message.@mcp.tool() async def send_announcement( channel: str, title: str, message: str, author: Optional[str] = None, timestamp: Optional[str] = None, thread_ts: Optional[str] = None ) -> str: """ Send a formatted announcement message. Args: channel: Channel ID or name title: Announcement title message: Main announcement message author: Author name (optional) timestamp: Custom timestamp (optional) thread_ts: Thread timestamp for replies (optional) """ try: blocks = [ BlockKitBuilder.header(f"📢 {title}"), BlockKitBuilder.section(message) ] # Add context with author and timestamp context_elements = [] if author: context_elements.append(f"*By:* {author}") if timestamp: context_elements.append(f"*Date:* {timestamp}") else: context_elements.append(f"*Date:* {datetime.now().strftime('%Y-%m-%d %H:%M')}") if context_elements: blocks.append(BlockKitBuilder.context(context_elements)) fallback_text = f"📢 {title}: {message}" client = SlackClient() result = await client.send_message(channel, fallback_text, thread_ts, blocks) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)