send_list_message
Send formatted list messages to Slack channels, including a title, items, and optional description. Reply within threads using thread timestamps for organized communication.
Instructions
Send a formatted list message.
Args: channel: Channel ID or name title: List title items: Newline or comma-separated list items description: Optional description text thread_ts: Thread timestamp for replies (optional)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| description | No | ||
| items | Yes | ||
| thread_ts | No | ||
| title | Yes |
Implementation Reference
- slack_mcp/server.py:849-890 (handler)The primary handler function for the 'send_list_message' tool. It is decorated with @mcp.tool(), which registers it in the MCP server. The function processes a list of items (newline or comma-separated), builds Slack BlockKit blocks for a formatted list message, and sends it via SlackClient.@mcp.tool() async def send_list_message( channel: str, title: str, items: str, description: Optional[str] = None, thread_ts: Optional[str] = None ) -> str: """ Send a formatted list message. Args: channel: Channel ID or name title: List title items: Newline or comma-separated list items description: Optional description text thread_ts: Thread timestamp for replies (optional) """ try: blocks = [BlockKitBuilder.header(title)] if description: blocks.append(BlockKitBuilder.section(description)) blocks.append(BlockKitBuilder.divider()) # Process items if "\n" in items: item_list = [item.strip() for item in items.split("\n") if item.strip()] else: item_list = [item.strip() for item in items.split(",") if item.strip()] # Create formatted list formatted_items = "\n".join([f"• {item}" for item in item_list]) blocks.append(BlockKitBuilder.section(formatted_items)) fallback_text = f"{title}: {', '.join(item_list)}" 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:857-866 (schema)The docstring provides the input schema description for the tool, detailing parameters and their purposes.""" Send a formatted list message. Args: channel: Channel ID or name title: List title items: Newline or comma-separated list items description: Optional description text thread_ts: Thread timestamp for replies (optional) """
- slack_mcp/server.py:849-849 (registration)The @mcp.tool() decorator registers the send_list_message function as an MCP tool.@mcp.tool()