Slack
Apps & AutomationslackSlack is an Agent Skill for apps & automation published in the BuilderIO/agent-native repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Search Slack messages and read channel history across your workspaces. Use this skill when the user asks about Slack conversations, channel messages, or internal communications.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/BuilderIO/agent-native/blob/HEAD/templates/analytics/.builder/skills/slack/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/slack, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Slack Integration
Connection
- Base URL:
https://slack.com/api/ - Auth:
Authorization: Bearer $SLACK_BOT_TOKEN(or$SLACK_BOT_TOKEN_2for secondary workspace) - Credentials:
SLACK_BOT_TOKEN(primary),SLACK_BOT_TOKEN_2(secondary workspace) - Caching: 2-minute in-memory cache, max 200 entries; separate user/bot caches
Server Lib
- File:
server/lib/slack.ts
Exported Functions
| Function | Description |
|---|---|
getTeamInfo(workspace) | Get workspace info |
listChannels(workspace) | List channels (paginated, first page cached) |
getChannelHistory(workspace, channelId, limit?, cursor?) | Channel message history |
searchMessages(workspace, query, count?) | Search messages |
getUserInfo(workspace, userId) | Get user info (cached per user) |
getBotInfo(workspace, botId) | Get bot info (cached) |
resolveUsers(workspace, userIds, messages?) | Batch resolve user names |
Agent Action
Use slack-messages for agent-facing Slack reads. Do not call
/api/slack/* directly from the agent.
| Mode | Args | Description |
|---|---|---|
team | workspace | Get workspace info |
channels | workspace | List channels |
history | workspace, channel, limit, cursor | Read channel history |
multi-history | workspace, channels, names, limit, cursors | Read multiple channels |
search | workspace, query | Search messages |
Key Patterns & Gotchas
- Two workspaces supported via workspace parameter ("primary" / "secondary")
getChannelHistoryauto-joins channels on "not_in_channel" error, then retries — requireschannels:joinscope- If auto-join fails, throws a detailed message explaining how to invite the bot
searchMessagesmay require user token; bot token tried firstlistChannelspaginates via cursor; only first page is cachedgetUserInforesolves bots viagetBotInfowhen needed