Home/Tools/@tpmjs/tools-slack

sendMessage

@tpmjs/tools-slack

Send a message to a Slack channel or thread.

Official
ops
v0.1.0
MIT

Interactive Playground

Test @tpmjs/tools-slack (sendMessage) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/tools-slack
pnpm add @tpmjs/tools-slack
yarn add @tpmjs/tools-slack
bun add @tpmjs/tools-slack
deno add npm:@tpmjs/tools-slack

2. Import the tool

import { sendMessage } from '@tpmjs/tools-slack';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { sendMessage } from '@tpmjs/tools-slack';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { sendMessage },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Signature

(text: string, channel: string, thread_ts?: string, unfurl_links?: boolean) => Promise<unknown>

Tags

agent
channel
message
messaging
ops
send
slack
thread
tpmjs

Parameters

Available configuration options

Auto-extracted
channel
Required
Type: string

Channel ID or name (e.g., "C1234567890" or "#general").

text
Required
Type: string

Message text (supports Slack markdown).

thread_ts
Optional
Type: string

Optional thread timestamp to reply in a thread.

unfurl_links
Optional
Type: boolean

Enable or disable link unfurling (default: true).

Schema extracted: 3/1/2026, 4:27:40 AM

README

@tpmjs/tools-slack

Slack API tools for AI agents. Send messages, manage channels, list users, search messages, upload files, and more.

Installation

npm install @tpmjs/tools-slack

Setup

Set the SLACK_BOT_TOKEN environment variable. Get your token from Slack API Apps.

Required bot scopes: chat:write, channels:read, channels:history, users:read, reactions:write, files:write, search:read.

Usage

import { sendMessage, listChannels } from '@tpmjs/tools-slack';

const result = await sendMessage.execute({ channel: '#general', text: 'Hello from AI!' });
const channels = await listChannels.execute({});

Tools

ToolDescription
sendMessageSend a message to a channel or thread
listChannelsList workspace channels by type
getChannelGet channel details
listUsersList workspace users
getUserGet user profile details
addReactionAdd emoji reaction to a message
uploadFileUpload a text file or snippet
setChannelTopicSet a channel's topic
listMessagesGet recent messages from a channel
searchMessagesSearch messages across the workspace

License

MIT

Statistics

Downloads/month

45

GitHub Stars

14

Quality Score

85%

Bundle Size

NPM Keywords

tpmjs
slack
messaging
ops
agent

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai
sendMessage | TPMJS | TPMJS