send_form_message
Send interactive form messages in Slack with select menus. Specify channel, title, description, and options to gather user input efficiently. Supports thread replies for organized conversations.
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
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| description | Yes | ||
| select_action_id | No | form_select | |
| select_options | Yes | ||
| select_placeholder | No | Choose an option | |
| thread_ts | No | ||
| title | Yes |
Implementation Reference
- slack_mcp/server.py:980-1028 (handler)The main handler function for the 'send_form_message' tool, decorated with @mcp.tool() for registration. It constructs a Slack Block Kit message with a header, description section, and interactive select menu from JSON options, then sends it via SlackClient.@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)