Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

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
NameRequiredDescriptionDefault
buttonsYes
channelYes
descriptionYes
thread_tsNo
titleYes

Implementation Reference

  • 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)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/piekstra/slack-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server