Skip to main content
Glama
ubie-oss

Slack MCP Server

by ubie-oss

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

  • Handler function that executes the slack_post_message tool: validates input with PostMessageRequestSchema, posts message via Slack WebClient, returns success confirmation.
    case 'slack_post_message': {
      const args = PostMessageRequestSchema.parse(request.params.arguments);
      const response = await slackClient.chat.postMessage({
        channel: args.channel_id,
        text: args.text,
      });
      if (!response.ok) {
        throw new Error(`Failed to post message: ${response.error}`);
      }
      return {
        content: [{ type: 'text', text: 'Message posted successfully' }],
      };
    }
  • Input schema definition (Zod) for the slack_post_message tool, specifying channel_id and text parameters.
    export const PostMessageRequestSchema = z.object({
      channel_id: z.string().describe('The ID of the channel to post to'),
      text: z.string().describe('The message text to post'),
    });
  • src/index.ts:121-125 (registration)
    Tool registration in the ListTools response, including name, description, and input schema reference.
    {
      name: 'slack_post_message',
      description: 'Post a new message to a Slack channel',
      inputSchema: zodToJsonSchema(PostMessageRequestSchema),
    },

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

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