send_announcement
Send formatted announcements to Slack channels with titles, messages, and optional author attribution for team communication.
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 |
|---|---|---|---|
| channel | Yes | ||
| title | Yes | ||
| message | Yes | ||
| author | No | ||
| timestamp | No | ||
| thread_ts | No |
Implementation Reference
- slack_mcp/server.py:1031-1076 (handler)The send_announcement tool handler, registered via @mcp.tool() decorator. Constructs Block Kit blocks for a formatted announcement including title, message, author, and timestamp, then sends via 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)