Skip to main content
Glama
Strand-AI

Slack Notifier MCP

by Strand-AI

send

Send formatted Slack messages to channels or threads. Use urgency to add @here mentions for critical alerts, reply in threads, and @mention specific users. Supports Slack mrkdwn formatting.

Instructions

Send a message to a Slack channel or thread.

Args: message: Message text. Supports Slack mrkdwn formatting. channel: Channel name or ID. Uses SLACK_DEFAULT_CHANNEL if not specified. thread_ts: Thread timestamp to reply in a thread. urgency: Message urgency level. 'critical' adds @here mention. mention_user: If True, @mentions the configured user (requires SLACK_USER_ID).

Returns: Dict with success status and message details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes
channelNo
thread_tsNo
urgencyNonormal
mention_userNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function for the 'send' tool. Formats the message based on urgency and mention_user flags, then calls client.send_message() and returns a dict with success status and message details.
    def send(
        message: str,
        channel: str | None = None,
        thread_ts: str | None = None,
        urgency: Literal["normal", "important", "critical"] = "normal",
        mention_user: bool = False,
    ) -> dict:
        """Send a message to a Slack channel or thread.
    
        Args:
            message: Message text. Supports Slack mrkdwn formatting.
            channel: Channel name or ID. Uses SLACK_DEFAULT_CHANNEL if not specified.
            thread_ts: Thread timestamp to reply in a thread.
            urgency: Message urgency level. 'critical' adds @here mention.
            mention_user: If True, @mentions the configured user (requires SLACK_USER_ID).
    
        Returns:
            Dict with success status and message details.
        """
        client = _get_client()
    
        # Add user mention if requested
        mention_prefix = ""
        if mention_user:
            mention = client.mention_user()
            if mention:
                mention_prefix = f"{mention} "
    
        # Format message based on urgency
        if urgency == "critical":
            formatted_message = f"{mention_prefix}<!here> :rotating_light: *CRITICAL*\n{message}"
        elif urgency == "important":
            formatted_message = f"{mention_prefix}:warning: *Important*\n{message}"
        else:
            formatted_message = f"{mention_prefix}{message}"
    
        result = client.send_message(text=formatted_message, channel=channel, thread_ts=thread_ts)
    
        if result.ok:
            return {
                "success": True,
                "message": "Message sent",
                "ts": result.ts,
                "channel": result.channel,
            }
        else:
            return {
                "success": False,
                "message": f"Failed to send message: {result.error}",
                "error": result.error,
            }
  • Registration of the 'send' tool via @mcp.tool() decorator. This is the entry point that delegates to the handler in tools/messaging.py.
    @mcp.tool()
    def send(
        message: str,
        channel: str | None = None,
        thread_ts: str | None = None,
        urgency: Literal["normal", "important", "critical"] = "normal",
        mention_user: bool = False,
    ) -> dict:
        """Send a message to a Slack channel or thread.
    
        Args:
            message: Message text. Supports Slack mrkdwn formatting.
            channel: Channel name or ID. Uses SLACK_DEFAULT_CHANNEL if not specified.
            thread_ts: Thread timestamp to reply in a thread.
            urgency: Message urgency level. 'critical' adds @here mention.
            mention_user: If True, @mentions the configured user (requires SLACK_USER_ID).
    
        Returns:
            Dict with success status and message details.
        """
        from .tools.messaging import send as _send
    
        return _send(
            message=message,
            channel=channel,
            thread_ts=thread_ts,
            urgency=urgency,
            mention_user=mention_user,
        )
  • Function signature/type schema for the 'send' tool: accepts message (str), channel (optional str), thread_ts (optional str), urgency (Literal normal/important/critical), and mention_user (bool).
    def send(
        message: str,
        channel: str | None = None,
        thread_ts: str | None = None,
        urgency: Literal["normal", "important", "critical"] = "normal",
        mention_user: bool = False,
    ) -> dict:
  • SendResult dataclass used as the return type from client.send_message(). Contains ok, ts, channel, and error fields.
    @dataclass
    class SendResult:
        """Result of sending a message."""
    
        ok: bool
        ts: str | None = None
        channel: str | None = None
        error: str | None = None
  • SlackClient.send_message() - the low-level helper that calls the Slack API chat.postMessage to actually send the message.
    def send_message(
        self,
        text: str,
        channel: str | None = None,
        thread_ts: str | None = None,
    ) -> SendResult:
        """Send a message to a Slack channel or thread.
    
        Args:
            text: Message text (supports Slack mrkdwn formatting)
            channel: Channel ID or name. Uses default if not specified.
            thread_ts: Thread timestamp to reply in a thread.
    
        Returns:
            SendResult with message timestamp if successful.
        """
        target_channel = channel or self.config.default_channel
        if not target_channel:
            return SendResult(
                ok=False,
                error="No channel specified and no default channel configured. "
                "Set SLACK_DEFAULT_CHANNEL or pass channel parameter.",
            )
    
        try:
            result = self.client.chat_postMessage(
                channel=target_channel,
                text=text,
                thread_ts=thread_ts,
            )
    
            return SendResult(
                ok=True,
                ts=result["ts"],
                channel=result["channel"],
            )
    
        except SlackApiError as e:
            return SendResult(ok=False, error=str(e.response["error"]))
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It explains message formatting (mrkdwn), channel default, thread replies, urgency effects (@here), and mention requirement (SLACK_USER_ID). However, it omits potential side effects, rate limits, or error conditions, so it is adequate but not fully transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (two paragraphs) with a clear 'Args' and 'Returns' structure. Every sentence adds value, starting with a direct purpose statement. No redundant or vague phrases.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters and an output schema, the description covers all parameters and the return type. It addresses common usage scenarios but lacks details on error responses or prerequisites (e.g., Slack permissions). Still, it is mostly complete for typical operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description compensates fully by explaining each parameter: message (mrkdwn), channel (default, name/ID), thread_ts (timing), urgency (enum with @here), and mention_user (boolean with config requirement). It adds meaning beyond the schema's type/enum constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Send a message to a Slack channel or thread.', specifying the action and the target resource. It is distinct from sibling tools 'ask_user' (likely for questioning) and 'get_thread_replies' (fetching responses), so the agent can easily differentiate when to use this tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides context on when to use specific parameters like 'thread_ts' for replying and 'urgency' for priority. It also mentions default channel and @mentions. Although it doesn't explicitly state 'when not to use' or compare to siblings, the purpose and parameter guidance are clear enough for most use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Strand-AI/slack-notifier-mcp'

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