send_notification_message
Send structured Slack notifications with status indicators to communicate updates, alerts, or information clearly within channels or threads.
Instructions
Send a structured notification message with status indicator.
Args: channel: Channel ID or name status: Status type (success, warning, error, info) title: Notification title description: Main description details: Additional details (optional) thread_ts: Thread timestamp for replies (optional)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| status | Yes | ||
| title | Yes | ||
| description | Yes | ||
| details | No | ||
| thread_ts | No |
Implementation Reference
- slack_mcp/server.py:795-847 (handler)The handler function for the 'send_notification_message' tool. It constructs a Block Kit message with a status emoji and color-coded notification, sends it to the specified Slack channel using SlackClient.send_message, and returns the API response as JSON.@mcp.tool() async def send_notification_message( channel: str, status: str, title: str, description: str, details: Optional[str] = None, thread_ts: Optional[str] = None ) -> str: """ Send a structured notification message with status indicator. Args: channel: Channel ID or name status: Status type (success, warning, error, info) title: Notification title description: Main description details: Additional details (optional) thread_ts: Thread timestamp for replies (optional) """ try: # Status emojis and colors status_config = { "success": {"emoji": "✅", "color": "#28a745"}, "warning": {"emoji": "⚠️", "color": "#ffc107"}, "error": {"emoji": "❌", "color": "#dc3545"}, "info": {"emoji": "ℹ️", "color": "#17a2b8"} } config = status_config.get(status.lower(), status_config["info"]) blocks = [ { "type": "section", "text": { "type": "mrkdwn", "text": f"{config['emoji']} *{title}*\n{description}" } } ] if details: blocks.append(BlockKitBuilder.divider()) blocks.append(BlockKitBuilder.context([details])) fallback_text = f"{config['emoji']} {title}: {description}" 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)
- slack_mcp/server.py:795-795 (registration)The @mcp.tool() decorator registers the send_notification_message function as an MCP tool.@mcp.tool()
- slack_mcp/server.py:804-814 (schema)Input schema defined by function parameters and detailed in the docstring.""" Send a structured notification message with status indicator. Args: channel: Channel ID or name status: Status type (success, warning, error, info) title: Notification title description: Main description details: Additional details (optional) thread_ts: Thread timestamp for replies (optional) """
- slack_mcp/server.py:102-115 (helper)SlackClient.send_message method used by the tool to post the notification to Slack API.async def send_message( self, channel: str, text: str, thread_ts: Optional[str] = None, blocks: Optional[List[Dict[str, Any]]] = None ) -> Dict[str, Any]: """Send a message to a channel.""" data = {"channel": channel, "text": text} if thread_ts: data["thread_ts"] = thread_ts if blocks: data["blocks"] = blocks return await self._make_request("POST", "chat.postMessage", json_data=data)