@tpmjs/tools-slack
Retrieve recent messages from a Slack channel.
Test @tpmjs/tools-slack (listMessages) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-slackpnpm add @tpmjs/tools-slackyarn add @tpmjs/tools-slackbun add @tpmjs/tools-slackdeno add npm:@tpmjs/tools-slackimport { listMessages } from '@tpmjs/tools-slack';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { listMessages } from '@tpmjs/tools-slack';
const result = await generateText({
model: openai('gpt-4o'),
tools: { listMessages },
prompt: 'Your prompt here...',
});
console.log(result.text);(channel: string, limit?: number, cursor?: string, latest?: string, oldest?: string) => Promise<unknown>Available configuration options
channelstringChannel ID.
limitnumberNumber of messages to return (1-1000, default: 100).
cursorstringPagination cursor from previous response.
oldeststringOnly messages after this Unix timestamp (e.g., "1234567890.123456").
lateststringOnly messages before this Unix timestamp (e.g., "1234567890.123456").
Schema extracted: 2/21/2026, 4:12:31 AM
Slack API tools for AI agents. Send messages, manage channels, list users, search messages, upload files, and more.
npm install @tpmjs/tools-slack
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.
import { sendMessage, listChannels } from '@tpmjs/tools-slack'; const result = await sendMessage.execute({ channel: '#general', text: 'Hello from AI!' }); const channels = await listChannels.execute({});
| Tool | Description |
|---|---|
| sendMessage | Send a message to a channel or thread |
| listChannels | List workspace channels by type |
| getChannel | Get channel details |
| listUsers | List workspace users |
| getUser | Get user profile details |
| addReaction | Add emoji reaction to a message |
| uploadFile | Upload a text file or snippet |
| setChannelTopic | Set a channel's topic |
| listMessages | Get recent messages from a channel |
| searchMessages | Search messages across the workspace |
MIT
Downloads/month
45
GitHub Stars
14
Quality Score