send_form_message
Send interactive form messages with select menus in Slack channels to collect user responses and streamline feedback gathering.
Instructions
Send a form-like message with a select menu.
Args: channel: Channel ID or name title: Form title description: Form description select_options: JSON string of select options [{"text": "Option 1", "value": "opt1"}] select_placeholder: Placeholder text for select menu select_action_id: Action ID for the select menu thread_ts: Thread timestamp for replies (optional)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| title | Yes | ||
| description | Yes | ||
| select_options | Yes | ||
| select_placeholder | No | Choose an option | |
| select_action_id | No | form_select | |
| thread_ts | No |
Implementation Reference
- slack_mcp/server.py:980-1028 (handler)The send_form_message tool handler function. It is registered via the @mcp.tool() decorator and implements sending a Slack message with a Block Kit form containing a select menu.@mcp.tool() async def send_form_message( channel: str, title: str, description: str, select_options: str, select_placeholder: str = "Choose an option", select_action_id: str = "form_select", thread_ts: Optional[str] = None ) -> str: """ Send a form-like message with a select menu. Args: channel: Channel ID or name title: Form title description: Form description select_options: JSON string of select options [{"text": "Option 1", "value": "opt1"}] select_placeholder: Placeholder text for select menu select_action_id: Action ID for the select menu thread_ts: Thread timestamp for replies (optional) """ try: blocks = [ BlockKitBuilder.header(title), BlockKitBuilder.section(description) ] # Parse select options options = json.loads(select_options) select_menu = BlockKitBuilder.select_menu( placeholder=select_placeholder, action_id=select_action_id, options=options ) blocks.append(BlockKitBuilder.section_with_accessory( "Please make your selection:", select_menu )) 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)
- slack_mcp/server.py:659-681 (helper)BlockKitBuilder.select_menu method, a key helper used to create the interactive select menu element in the form message.def select_menu(placeholder: str, action_id: str, options: List[Dict[str, str]]) -> Dict[str, Any]: """Create a static select menu element.""" return { "type": "static_select", "placeholder": { "type": "plain_text", "text": placeholder }, "action_id": action_id, "options": [ { "text": { "type": "plain_text", "text": option["text"] }, "value": option["value"] } for option in options ] } @staticmethod def section_with_accessory(text: str, accessory: Dict[str, Any], text_type: str = "mrkdwn") -> Dict[str, Any]:
- slack_mcp/server.py:681-691 (helper)BlockKitBuilder.section_with_accessory method, used to attach the select menu as an accessory to the section block.def section_with_accessory(text: str, accessory: Dict[str, Any], text_type: str = "mrkdwn") -> Dict[str, Any]: """Create a section block with an accessory element.""" return { "type": "section", "text": { "type": text_type, "text": text }, "accessory": accessory }