Skip to main content
Glama
z9905080

MCP Server for Slack

by z9905080

slack_post_message

Send messages to Slack channels using channel IDs and text content to facilitate team communication and notifications.

Instructions

Post a new message to a Slack channel

Input Schema

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

Implementation Reference

  • Executes the slack_post_message tool by validating input arguments and invoking the SlackClient.postMessage method to send the message.
    case "slack_post_message": {
      const args = request.params.arguments as unknown as PostMessageArgs;
      if (!args.channel_id || !args.text) {
        throw new Error(
          "Missing required arguments: channel_id and text",
        );
      }
      const response = await slackClient.postMessage(
        args.channel_id,
        args.text,
      );
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Defines the input schema and metadata for the slack_post_message tool.
    const postMessageTool: Tool = {
      name: "slack_post_message",
      description: "Post a new message to a Slack channel",
      inputSchema: {
        type: "object",
        properties: {
          channel_id: {
            type: "string",
            description: "The ID of the channel to post to",
          },
          text: {
            type: "string",
            description: "The message text to post",
          },
        },
        required: ["channel_id", "text"],
      },
    };
  • index.ts:567-582 (registration)
    Registers the slack_post_message tool (as postMessageTool) in the ListTools response.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      console.log("Received ListToolsRequest");
      return {
        tools: [
          listChannelsTool,
          postMessageTool,
          replyToThreadTool,
          addReactionTool,
          getChannelHistoryTool,
          getThreadRepliesTool,
          getUsersTool,
          getUserProfileTool,
          lookupUserByEmailTool,
        ],
      };
    });
  • SlackClient helper method that performs the HTTP POST to Slack's chat.postMessage API endpoint.
    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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Post a new message') but lacks details on permissions required, rate limits, error handling, or what happens on success (e.g., message ID returned). This is inadequate for a mutation tool with zero annotation coverage, as critical behavioral traits are missing.

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 purpose without unnecessary words. It is front-loaded and appropriately sized, with every part contributing essential information, making it highly concise and well-structured.

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

Completeness2/5

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

Given the tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It fails to explain behavioral aspects like permissions or response format, and while the schema covers parameters, the overall context for safe and effective use is lacking, making it insufficient for an AI agent.

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?

The input schema has 100% description coverage, with clear parameter descriptions for 'channel_id' and 'text'. The description does not add any semantic details beyond what the schema provides (e.g., format examples or constraints), so it meets the baseline score of 3 where the schema handles the heavy lifting.

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 new message') and target resource ('to a Slack channel'), making the purpose immediately understandable. However, it does not explicitly differentiate this tool from sibling tools like 'slack_reply_to_thread' or 'slack_add_reaction', which also involve posting content in Slack, leaving some ambiguity in sibling differentiation.

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. It does not mention prerequisites (e.g., channel access), exclusions (e.g., not for threads or reactions), or refer to sibling tools like 'slack_reply_to_thread' for thread-specific replies, leaving the agent to infer usage context without explicit direction.

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

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