At a glance
- Availability: Experimental (how to enable).
- Auth: API key.
- Connection: The key from
DISCORD_BOT_TOKENis sent as theBotprefixedAuthorizationheader. - Docs: https://discord.com/developers/docs/reference#authentication
Credentials
Set these per environment. See Connect an integration.| Variable | Required | Description |
|---|---|---|
DISCORD_BOT_TOKEN | Yes | Discord bot token from the Bot tab of your application in the Discord Developer Portal Docs. |
Setup
- Create a Discord application: Go to https://discord.com/developers/applications, sign in with any Discord account (free), and click New Application. For testing, create your own free Discord server first so you have a safe place to invite the bot.
- Get the bot token: Open your application’s Bot tab and click Reset Token to reveal the bot token. Copy it immediately (it is shown once) and set it as DISCORD_BOT_TOKEN. Resetting again invalidates the previous token.
- Enable privileged intents: On the Bot tab, under Privileged Gateway Intents, enable Message Content Intent. Without it, the content field of most messages returned by the API is empty for the bot. Enable Server Members Intent too if you need member data.
- Invite the bot to your server: In OAuth2 > URL Generator, select the bot scope, then grant permissions such as View Channels, Send Messages, Read Message History, Add Reactions, and Create Public Threads. Open the generated URL in a browser and add the bot to your server (requires Manage Server permission there).
- The bot can only see and post in servers it has been invited to and channels its role can access.
- Message content in API responses is empty unless the Message Content privileged intent is enabled (bots in fewer than 100 servers can enable it directly in the portal).
- Discord rate limits per route; bulk reads should page with before/after cursors rather than tight loops.
Tools
| Tool | Access | Description |
|---|---|---|
| Get Bot User | Read | Get the bot’s own user account to confirm the token works and learn the bot’s ID and username |
| List Guilds | Read | List the servers (guilds) the bot has been added to, so an agent can find a guild ID |
| List Guild Channels | Read | List the channels in a server so an agent can find the right channel ID before reading or posting |
| Get Channel Messages | Read | Read recent messages from a channel for summaries, support triage, or context before replying |
| Send Message | Write | Post a message to a channel, optionally as a reply to an existing message |
| Create DM Channel | Write | Open (or return the existing) direct-message channel with a user; use the returned channel ID with Send Message to DM the user |
| Edit Message | Write | Edit the text of a message the bot previously sent, e.g. to update a status post or correct an announcement |
| Search Guild Members | Read | Find members of a server whose username or nickname starts with a string, e.g. to resolve a name to a user ID for mentions or DMs |
| Add Reaction | Write | React to a message with an emoji, e.g. to acknowledge or label it |
| Create Thread | Write | Start a thread from an existing message to keep a discussion organized |
Example prompts
- Read the latest messages in our Discord support channel and summarize the main topics and any unanswered questions.
- Post a release announcement to our Discord announcements channel.
- Find recent questions in our Discord server, react to the ones already handled, and start a thread for the most important open one.