Slack Integration

DevBoy tools provide integration with Slack for searching chat history, fetching messages, and posting structured notifications through AI assistants. Slack is the first provider in the Messenger category.

Authentication

Slack uses an OAuth-issued bot token (Bot User OAuth Token, xoxb-…):

Auth MethodToken Source
Bearer Token (Bot User OAuth Token)Slack App OAuth & Permissions page

The bot needs the following OAuth scopes — devboy doctor will tell you which ones are missing:

ScopeUsed by
channels:readlisting channels
channels:historyreading channel messages
groups:read / groups:historyprivate channels
im:read / im:historyDMs
mpim:read / mpim:historygroup DMs
chat:writeposting messages
search:readsearching messages
users:readresolving user IDs into names

You can list extra required scopes via slack.required_scopes in config (the doctor check enforces them).

Configuration

Basic configuration

# Store the Slack bot token in OS keychain
devboy config set-secret slack.token <xoxb-...>

Configuration file

~/.config/devboy-tools/config.toml:

[slack]
# Token is stored in the OS keychain, not in the config file.
# Optional — list of scope names you require beyond the defaults.
required_scopes = ["channels:read", "channels:history", "chat:write"]

# Optional — point at a Slack-compatible API (e.g. Mattermost in Slack-API mode).
# base_url = "https://slack.example.com/api"

Environment variables

export DEVBOY_SLACK_TOKEN=xoxb-...

Available tools

The Slack provider implements the Messenger category. The same four tools are exposed for any Messenger-class provider; this page documents the shape against Slack.

get_messenger_chats

List channels / DMs visible to the bot.

ParameterTypeDescription
kindstringchannel, private, dm, mpim, or all (default: all)
querystringOptional name filter
limitintegerMax results (default: 50)
cursorstringPagination cursor (returned by previous call)

get_chat_messages

Fetch recent messages from one chat.

ParameterTypeRequiredDescription
chat_idstringYesChannel / IM ID
limitintegerNoDefault 50
beforestringNoISO 8601 timestamp; return messages older than this
afterstringNoISO 8601 timestamp; return messages newer than this
cursorstringNoPagination cursor

search_chat_messages

Full-text search across messages the bot can see.

ParameterTypeRequiredDescription
querystringYesSlack search syntax (from:@alice in:#sprint)
chat_idstringNoRestrict to one channel
limitintegerNoDefault 50

send_message

Post a message to a channel / DM.

ParameterTypeRequiredDescription
chat_idstringYesTarget channel / IM ID
textstringYesMessage body (Slack mrkdwn)
thread_tsstringNoReply in thread
blocksobject[]NoSlack Block Kit blocks
attachmentsobject[]NoLegacy attachments

Doctor check

devboy doctor --checks providers.slack

Verifies:

  1. The bot token authenticates against auth.test.
  2. All scopes listed in slack.required_scopes are present on the token.
  3. Reports the missing scopes in the diagnostic output if any.

Use cases

  1. Daily summarychat-summary skill summarises the last 24 h of a channel for a stand-up note.
  2. Notificationnotify posts a structured message after a long-running CI / deploy.
  3. Decision archaeologychat-search lets the agent grep team channels for "why did we choose Postgres over MySQL".

API reference