send_interactive_message
Send Slack messages with interactive buttons to collect user responses, trigger actions, or gather feedback directly in channels or threads.
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 |
|---|---|---|---|
| channel | Yes | ||
| title | Yes | ||
| description | Yes | ||
| buttons | Yes | ||
| thread_ts | No |
Implementation Reference
- slack_mcp/server.py:893-942 (handler)The primary handler function for the 'send_interactive_message' MCP tool. Decorated with @mcp.tool() for registration. Parses button JSON, builds interactive Block Kit blocks using BlockKitBuilder, and sends the message via SlackClient.@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)