Overview
Telegram tool allows you to send messages, photos, and documents via Telegram bots. The user asks to send or read messages; the agent calls Telegram and returns the outcome.Installation
Environment Variables
Quick Start
1
Simple Usage
2
With Configuration
Use the same tool with an agent — see Usage with Agent below, or pass env vars and options from the sections above.
Available Methods
send_message(chat_id, text)
Send a text message.send_photo(chat_id, photo_url, caption=None)
Send a photo.Common Errors
How It Works
Best Practices
Store the bot token securely
Store the bot token securely
Read the Telegram bot token from the environment, never hard-code it.
Validate chat IDs
Validate chat IDs
Confirm the target chat ID before sending so messages reach the right conversation.
Handle rate limits
Handle rate limits
Telegram throttles bursts. Retry with backoff so the agent stays responsive.
Related Tools
Slack
Slack messaging
Discord
Discord messaging
WhatsApp messaging

