Post Message

Sends a message to a channel, private group, or DM

Usage #

// Import the typed helper
import { postMessage } from "@hotglue/sdk/slack";
const result = await client.execute({
...postMessage({
channel: string,
text: string,
blocks: array,
// ...
}),
userId: "user_123",
});
// result is typed as PostMessageOutput
const result = await client.execute({
integration: "slack",
tool: "post_message",
userId: "user_123",
input: {
channel: string,
text: string,
blocks: array,
// ...
},
});
// The agent will automatically use this tool when needed
const agent = new Agent({
tools: () => hotglueTools({
integrations: ["slack"],
userId: "user_123",
}),
});
await agent.generate("run the Post Message tool");

Required Permissions #

chat:write

Input Schema #

channel string required

Channel ID, private group ID, or user ID to send the message to

text string

Message text. Required if blocks is not provided. Used as fallback text for notifications.

blocks object[]

An array of Block Kit blocks for rich message formatting

thread_ts string

Timestamp of another message to reply to in a thread

reply_broadcast bool

When replying in a thread, also post to the channel

default: false
unfurl_links bool

Enable unfurling of primarily text-based content

default: true
unfurl_media bool

Enable unfurling of media content

default: true
mrkdwn bool

Enable Slack markdown parsing

default: true

Output Schema #

ok bool required
channel string
ts string

Message timestamp

message object

This tool calls: #

POST https://slack.com/api/chat.postMessage