Skip to main content
Glama

post_message

Send messages to Slack channels to communicate updates, share information, or coordinate with team members directly from your application.

Instructions

Post a message to a Slack channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes
textYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:145-156 (handler)
    The handler function for the 'post_message' tool, which posts a message to a specified Slack channel using the Slack chat.postMessage API. Registered via @mcp.tool() decorator.
    @mcp.tool()
    async def post_message(channel_id: str, text: str) -> str:
        """Post a message to a Slack channel."""
        params = {
            "channel": channel_id,
            "text": text
        }
        data = await make_slack_request("chat.postMessage", params)
        if data and data.get("ok"):
            return "✅ Message posted successfully!"
        return f"❌ Failed to post message. Error: {data.get('error', 'Unknown')}"
  • main.py:19-33 (helper)
    Helper utility function used by post_message to make authenticated HTTP requests to the Slack API.
    async def make_slack_request(method: str, params: dict[str, Any] | None = None) -> dict[str, Any] | None:
        """Make a request to the Slack Web API with proper error handling."""
        headers = {
            "Authorization": f"Bearer {SLACK_TOKEN}",
            "Content-Type": "application/x-www-form-urlencoded"
        }
        async with httpx.AsyncClient() as client:
            try:
                response = await client.post(f"{SLACK_API_BASE}/{method}", data=params, headers=headers, timeout=10.0)
                response.raise_for_status()
                return response.json()
            except Exception as e:
                print(f"Slack API error: {e}")
                return None
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Post') but doesn't mention any behavioral traits like required permissions, rate limits, whether the message is editable, or what happens on success/failure. This leaves significant gaps for a mutation tool.

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 a single, efficient sentence that directly states the tool's function without any wasted words. It's appropriately sized and front-loaded with the core purpose.

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

Completeness3/5

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

Given this is a mutation tool with no annotations, 0% schema coverage, but an output schema exists, the description is minimally adequate. The output schema may cover return values, but the description lacks context about permissions, error handling, or usage scenarios, leaving it incomplete for safe operation.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain what 'channel_id' represents (e.g., format like C123456) or what 'text' can contain (e.g., markdown, emojis, attachments). This leaves both parameters semantically unclear.

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

Purpose4/5

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

The description clearly states the action ('Post a message') and target resource ('to a Slack channel'), making the purpose immediately understandable. However, it doesn't differentiate this from sibling tools like 'get_recent_slack_messages' or 'get_user_messages', which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. There are sibling tools for retrieving messages, but no indication of when posting is appropriate versus reading, or any prerequisites like channel access permissions.

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/Abu-BakarYasir/my_slack_mcp'

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