Overview
Discord tool allows you to send messages via webhooks or bot tokens to Discord servers. The user asks to post or read messages; the agent calls Discord and returns the outcome.Installation
Environment Variables
Quick Start
Usage with Agent
Available Methods
send_webhook(content, username=None)
Send a message via webhook.send_message(channel_id, content)
Send a message to a channel (requires bot token).Common Errors
| Error | Cause | Solution |
|---|---|---|
DISCORD_WEBHOOK_URL not configured | Missing webhook | Set environment variable |
Invalid webhook | Wrong URL | Check webhook URL |
Rate limited | Too many messages | Add delays |
How It Works
Best Practices
Store the bot token securely
Store the bot token securely
Read the Discord token from the environment, never hard-code it in the tool.
Scope bot permissions
Scope bot permissions
Grant the bot only the channels and permissions it needs for the task.
Handle rate limits
Handle rate limits
Discord returns HTTP 429 under load. Retry with backoff so the agent stays responsive.
Related Tools
Slack
Slack messaging
Telegram
Telegram bot
Email notifications

