send_message
Send a text message to a Slack channel. Provide the message content; optionally specify the channel ID.
Instructions
Send a message to a Slack channel
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | No | Slack channel ID. If not provided, uses the build channel. | |
| text | Yes | Message text to send |
Implementation Reference
- index.js:107-123 (registration)Tool 'send_message' is registered in the ListToolsRequestSchema handler with its name, description, and inputSchema (requiring channel_id and text).
name: "send_message", description: "Send a message to a Slack channel", inputSchema: { type: "object", properties: { channel_id: { type: "string", description: "Slack channel ID. If not provided, uses the build channel.", }, text: { type: "string", description: "Message text to send", }, }, required: ["text"], }, }, - index.js:392-435 (handler)Handler for 'send_message' tool call: validates channel_id and text parameters, then uses slack.chat.postMessage API to send the message to the specified Slack channel. Returns success status, timestamp, and channel ID.
case "send_message": { const channelId = args?.channel_id || buildChannelId; const text = args?.text; if (!channelId) { return { content: [ { type: "text", text: "Error: No channel_id provided and SLACK_BUILD_CHANNEL_ID not configured.", }, ], }; } if (!text) { return { content: [ { type: "text", text: "Error: text parameter is required", }, ], }; } const result = await slack.chat.postMessage({ channel: channelId, text: text, }); return { content: [ { type: "text", text: JSON.stringify({ success: result.ok, timestamp: result.ts, channel: result.channel, }, null, 2), }, ], }; }