Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DATA_DIR | No | The directory where downloaded chat data and media files will be stored. | |
| TELEGRAM_API_ID | Yes | The API ID for your Telegram application, obtained from my.telegram.org. | |
| TELEGRAM_API_HASH | Yes | The API hash for your Telegram application, obtained from my.telegram.org. | |
| TELEGRAM_SESSION_PATH | No | The file path where the telegram.session file is located or should be saved. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| telegram_list_chats | List your Telegram dialogs (chats, groups, channels). Returns chat ID, title, type, and username. Use this to find the chat_id needed for other tools. |
| telegram_find_chat | Search for a specific chat by name, username, or ID. Returns the matching chat info or null if not found. |
| telegram_get_history | Fetch messages from a Telegram chat. Returns message text, sender, date, and media info. Does NOT download media files — use telegram_sync_chat for that. Useful for previewing chat contents before a full sync. |
| telegram_sync_chat | Full sync: downloads all messages and media files from a chat to local storage. Supports incremental sync — on subsequent runs, only fetches new messages. Files are saved to data/raw/{chat_id}/. This is the main tool for extracting chat data including photos and documents. Use since_date to limit the sync range, or omit for full/incremental sync. |
| telegram_download_media | Download media from a specific message. Use this for targeted downloads instead of a full sync. Returns file path and metadata. |
| telegram_sync_status | Check the sync status for a chat: last sync date, total synced messages, last message ID. Useful before deciding whether to run a new sync. |
| telegram_list_media | List all media files that have been downloaded for a chat. Requires a previous telegram_sync_chat run. Filter by type: photo, document, video, voice, or all. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |