Skip to main content
Glama
piekstra

Slack MCP Server

by piekstra

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
NameRequiredDescriptionDefault
channelYes
descriptionNo
itemsYes
thread_tsNo
titleYes

Implementation Reference

  • 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)
  • 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) """
  • The @mcp.tool() decorator registers the send_list_message function as an MCP tool.
    @mcp.tool()

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