| name | slack-tools |
| description | Send messages, upload files, and create canvases in Slack. Use when the agent needs to post updates to Slack channels, share files with a team, create documentation in Slack canvases, or reply to threads. Requires SLACK_BOT_TOKEN and slack_sdk package. |
Slack Tools
Send messages, upload files, and create Slack canvases.
Setup
- Install the SDK:
pip install slack_sdk
- Set
SLACK_BOT_TOKEN environment variable
- Ensure bot has required scopes (see API Reference)
Quick Start
python scripts/slack_tools.py channels
python scripts/slack_tools.py message -c C123456 -t "Hello from the agent!"
python scripts/slack_tools.py upload -c C123456 -f ./report.pdf
python scripts/slack_tools.py canvas --title "Project Notes" --content "# Overview\n\nDetails here..."
Commands
| Command | Description |
|---|
message -c CHANNEL -t TEXT | Send a message |
reply -c CHANNEL -t THREAD -text TEXT | Reply in a thread |
upload -c CHANNEL -f FILE | Upload a file |
upload-content -c CHANNEL --content TEXT -f NAME | Upload text as file |
canvas --title TITLE --content MD | Create standalone canvas |
canvas --channel ID --content MD | Create channel canvas |
edit-canvas -i ID --content MD | Edit existing canvas |
channels | List available channels |
channel-id -n NAME | Get channel ID from name |
Send Messages
python scripts/slack_tools.py message -c C123456 -t "Build completed successfully"
python scripts/slack_tools.py reply -c C123456 -t 1234567890.123456 --text "Fixed in latest commit"
python scripts/slack_tools.py reply -c C123456 -t 1234567890.123456 --text "Important update" --broadcast
Upload Files
python scripts/slack_tools.py upload -c C123456 -f ./report.pdf --title "Weekly Report"
python scripts/slack_tools.py upload -c C123456 -f ./data.csv --comment "Here's the data you requested"
python scripts/slack_tools.py upload-content -c C123456 --content "print('hello')" -f script.py --filetype python
Create Canvases
python scripts/slack_tools.py canvas --title "Project Plan" --content "# Goals\n\n- Item 1\n- Item 2"
python scripts/slack_tools.py canvas --channel C123456 --content "# Channel Guidelines\n\nRules here..."
python scripts/slack_tools.py canvas --title "Documentation" --file ./docs.md
python scripts/slack_tools.py edit-canvas -i F123456 --content "# Updated Content"
Response Format
All commands return JSON:
{
"success": true,
"channel": "C123456",
"ts": "1234567890.123456"
}
On error:
{
"success": false,
"error": "channel_not_found"
}
API Reference
See references/api_reference.md for scopes, methods, and rate limits.