send_interactive_message
Send interactive messages with buttons to Slack channels to engage users, gather responses, and streamline communication. Supports titles, descriptions, and customizable button actions for efficient workflows.
Instructions
Send an interactive message with buttons.
Args: channel: Channel ID or name title: Message title description: Message description buttons: JSON string of button configurations [{"text": "Button Text", "action_id": "action_1", "style": "primary"}] thread_ts: Thread timestamp for replies (optional)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buttons | Yes | ||
| channel | Yes | ||
| description | Yes | ||
| thread_ts | No | ||
| title | Yes |
Implementation Reference
- slack_mcp/server.py:893-940 (handler)The handler function for the 'send_interactive_message' MCP tool. It is decorated with @mcp.tool() for registration and implements sending an interactive Slack message with customizable buttons using Block Kit blocks.@mcp.tool() async def send_interactive_message( channel: str, title: str, description: str, buttons: str, thread_ts: Optional[str] = None ) -> str: """ Send an interactive message with buttons. Args: channel: Channel ID or name title: Message title description: Message description buttons: JSON string of button configurations [{"text": "Button Text", "action_id": "action_1", "style": "primary"}] thread_ts: Thread timestamp for replies (optional) """ try: blocks = [ BlockKitBuilder.header(title), BlockKitBuilder.section(description) ] # Parse button configurations button_configs = json.loads(buttons) button_elements = [] for btn_config in button_configs: button = BlockKitBuilder.button( text=btn_config["text"], action_id=btn_config["action_id"], value=btn_config.get("value"), url=btn_config.get("url"), style=btn_config.get("style") ) button_elements.append(button) if button_elements: blocks.append(BlockKitBuilder.actions(*button_elements)) fallback_text = f"{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)