Skip to main content
Glama
zencoderai

Slack

by zencoderai

Post Slack Message

slack_post_message

Post a message to a Slack channel or direct message using channel ID and text content.

Instructions

Post a new message to a Slack channel or direct message to user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYesThe ID of the channel or user to post to
textYesThe message text to post

Implementation Reference

  • index.ts:248-264 (registration)
    Registration of the 'slack_post_message' tool on the MCP server with its schema and handler callback.
    server.registerTool(
      "slack_post_message",
      {
        title: "Post Slack Message",
        description: "Post a new message to a Slack channel or direct message to user",
        inputSchema: {
          channel_id: z.string().describe("The ID of the channel or user to post to"),
          text: z.string().describe("The message text to post"),
        },
      },
      async ({ channel_id, text }) => {
        const response = await slackClient.postMessage(channel_id, text);
        return {
          content: [{ type: "text", text: JSON.stringify(response) }],
        };
      }
    );
  • TypeScript interface PostMessageArgs defining the input schema for the tool (channel_id and text).
    interface PostMessageArgs {
      channel_id: string;
      text: string;
    }
  • The handler function that executes the 'slack_post_message' tool logic, delegating to slackClient.postMessage().
    async ({ channel_id, text }) => {
      const response = await slackClient.postMessage(channel_id, text);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • SlackClient.postMessage() helper method that makes the actual HTTP POST to Slack's chat.postMessage API.
    async postMessage(channel_id: string, text: string): Promise<any> {
      const response = await fetch("https://slack.com/api/chat.postMessage", {
        method: "POST",
        headers: this.botHeaders,
        body: JSON.stringify({
          channel: channel_id,
          text: text,
        }),
      });
    
      return response.json();
    }
Behavior2/5

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

The description only states the basic action and target, failing to disclose behavioral traits like required permissions, message formatting, character limits, or whether the operation is reversible. With no annotations, the description carries the full burden and does not provide sufficient transparency.

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, clear sentence with no unnecessary words or repetition. It is appropriately concise.

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 the simple nature of the tool and no output schema, the description is minimally adequate but does not explain return values, error handling, or any side effects. For a tool with no annotations, more context would be beneficial.

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

Parameters3/5

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

Schema coverage is 100%, with descriptions for both channel_id and text in the schema. The description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

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 verb 'post', resource 'message', and target 'Slack channel or direct message to user'. It distinguishes the action from other tools like slack_reply_to_thread but does not explicitly differentiate.

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?

No guidance is provided on when to use this tool versus alternatives such as slack_reply_to_thread for thread replies or slack_add_reaction for adding reactions.

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/zencoderai/slack-mcp-server'

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