send_notification_message
Send structured notifications to Slack channels with status indicators for success, warning, error, or info. Include a title, description, and optional details or thread replies for context.
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 | ||
| description | Yes | ||
| details | No | ||
| status | Yes | ||
| thread_ts | No | ||
| title | Yes |
Implementation Reference
- slack_mcp/server.py:795-847 (handler)The main handler function for the 'send_notification_message' tool, decorated with @mcp.tool() for registration. It constructs a Slack block message with status emoji and color, sends it via SlackClient, and returns the JSON result or error.@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:796-814 (schema)Input schema defined by type annotations and detailed docstring describing parameters and return type.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) """