Telegram Bot MCP Server
Allows AI assistants to publish, edit, search, and manage text and photo messages in Telegram channels via a bot.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Telegram Bot MCP ServerPublish a message to @my_channel saying 'Hello from AI'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Telegram Bot MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to publish, edit, search, and manage messages in Telegram channels.
Features
Publish Text Messages: Post new text messages to Telegram channels with formatting support (Markdown/HTML)
Publish Photos: Post photos with optional captions to Telegram channels
Edit Text Messages: Modify existing text-only messages in channels
Edit Photo Captions: Update captions of existing photo messages
Delete Messages: Remove messages from channels
Search Messages: Search through cached messages (local cache)
Channel Info: Retrieve channel metadata and statistics
Related MCP server: Telegram Channel MCP Server
Quick Reference
Task | Message Type | Tool to Use |
Publish a text message | Text |
|
Publish a photo | Photo |
|
Edit a text-only message | Text |
|
Edit a photo's caption | Photo |
|
Delete any message | Any |
|
Search cached messages | Any |
|
Get channel info | - |
|
Important: You cannot use edit_message on photo messages or edit_message_caption on text messages!
Installation
Prerequisites
Python 3.10+ is required
Create a Telegram Bot:
Open Telegram and search for @BotFather
Send
/newbotand follow the instructionsCopy the bot token (format:
123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11)
Add Bot to Your Channel:
Create a Telegram channel or use an existing one
Add your bot as an administrator to the channel
Grant the bot permissions:
Post messages
Edit messages of others
Delete messages of others
Get Channel ID:
For public channels, use the username format:
@channelnameFor private channels, you need the numeric chat ID (e.g.,
-1001234567890)You can get this by:
Adding the bot to the channel
Sending a message to the channel
Checking the update using:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
Install from Source
# Clone the repository
git clone https://github.com/aggeentik/telegram-bot-mcp.git
cd telegram-bot-mcp
# Install with pip
pip install -e .
# Or install with uv (recommended)
uv pip install -e .For Development
# Install with dev dependencies
pip install -e ".[dev]"
# Or with uv
uv pip install -e ".[dev]"Configuration
Environment Variable
Set your Telegram bot token as an environment variable:
export TELEGRAM_BOT_TOKEN="your-bot-token-here"Or add it to your .env file:
TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11Claude Desktop Integration
Add this to your Claude Desktop configuration file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"telegram-bot": {
"command": "python",
"args": ["-m", "telegram_bot"],
"env": {
"TELEGRAM_BOT_TOKEN": "your-bot-token-here"
}
}
}
}Or if installed via uv:
{
"mcpServers": {
"telegram-bot": {
"command": "uvx",
"args": ["telegram-bot-mcp"],
"env": {
"TELEGRAM_BOT_TOKEN": "your-bot-token-here"
}
}
}
}Usage
Once configured, the server will be available to your MCP client (like Claude Desktop). You can ask the AI assistant to:
"Post a message to @mychannel saying 'Hello from AI!'"
"Publish a photo from /path/to/image.jpg to @mychannel with caption 'Check this out!'"
"Edit message 12345 in @mychannel to say 'Updated message'"
"Search for messages containing 'important' in @mychannel"
"Delete message 12345 from @mychannel"
"Get information about @mychannel"
Available Tools
publish_message
Publish a new message to a Telegram channel.
Parameters:
channel_id(str, required): Channel username (@mychannel) or chat IDtext(str, required): Message text to publishparse_mode(str, optional): Text formatting -"Markdown","HTML", or"None". Default:"Markdown"disable_web_page_preview(bool, optional): Disable link previews. Default:Falsedisable_notification(bool, optional): Send silently. Default:False
Returns:
{
"message_id": 12345,
"chat_id": -1001234567890,
"date": "2024-01-15T10:30:00",
"text": "Your message text",
"link": "https://t.me/mychannel/12345"
}publish_photo
Publish a photo to a Telegram channel with an optional caption.
Parameters:
channel_id(str, required): Channel username (@mychannel) or chat IDphoto(str, required): Photo to send (file path, URL, or file_id)caption(str, optional): Caption text with Markdown/HTML formatting. Max 1024 charactersparse_mode(str, optional): Caption formatting -"Markdown","HTML", or"None". Default:"Markdown"disable_notification(bool, optional): Send silently. Default:False
Returns:
{
"message_id": 12345,
"chat_id": -1001234567890,
"date": "2024-01-15T10:30:00",
"caption": "Photo caption text",
"photo": {
"file_id": "AgACAgIAAxkBAAMCY...",
"file_unique_id": "AQADAgATxxx",
"width": 1280,
"height": 720,
"file_size": 102400
},
"link": "https://t.me/mychannel/12345"
}edit_message
Edit an existing TEXT-ONLY message in a channel.
IMPORTANT: This only works for text messages. If the message contains a photo, use edit_message_caption instead.
Parameters:
channel_id(str, required): Channel username or chat IDmessage_id(int, required): ID of the message to editnew_text(str, required): New message textparse_mode(str, optional): Text formatting. Default:"Markdown"
edit_message_caption
Edit the caption of an existing PHOTO message in a channel.
IMPORTANT: This only works for messages with media. For text-only messages, use edit_message instead.
Parameters:
channel_id(str, required): Channel username or chat IDmessage_id(int, required): ID of the photo message to editnew_caption(str, required): New caption textparse_mode(str, optional): Caption formatting. Default:"Markdown"
delete_message
Delete a message from a channel.
Parameters:
channel_id(str, required): Channel username or chat IDmessage_id(int, required): ID of the message to delete
search_messages
Search messages in local cache (messages published/edited in current session).
Note: Telegram Bot API doesn't support native message search. This searches locally cached messages.
Parameters:
channel_id(str, required): Channel username or chat IDquery(str, optional): Search query (case-insensitive). If None, returns all cached messageslimit(int, optional): Maximum results to return. Default:10
get_channel_info
Get information about a Telegram channel.
Parameters:
channel_id(str, required): Channel username or chat ID
Returns:
{
"id": -1001234567890,
"title": "My Channel",
"username": "mychannel",
"type": "channel",
"description": "Channel description",
"invite_link": "https://t.me/mychannel",
"member_count": 1234,
"status": "success"
}Development
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run tests with verbose output
pytest -v
# Run tests with coverage
pytest --cov=telegram_bot --cov-report=html
# Run specific test
pytest tests/test_telegram.py::TestTelegramClient::test_publish_messageCode Quality
# Type checking
mypy telegram_bot
# Linting
ruff check .
# Formatting
ruff format .Running the Server Locally
For testing purposes, you can run the server directly:
# Set your bot token
export TELEGRAM_BOT_TOKEN="your-token"
# Run the server
python -m telegram_botThe server will start and communicate via stdio, following the MCP protocol.
Architecture
Component Structure
telegram-bot-mcp/
├── main.py # Entry point for the server
├── telegram_bot/
│ ├── __init__.py # Package initialization
│ ├── server.py # FastMCP server implementation with tool decorators
│ └── telegram_bot_client.py # TelegramBotClient wrapper
└── tests/
└── test_telegram.py # Comprehensive testsDesign Patterns
Singleton Client: Global
TelegramBotClientinstance reused across tool callsAsync-First: All I/O operations are async for better performance
Error Handling: Graceful error responses with status information
Local Cache: Message caching for search functionality (since Telegram API doesn't support search)
Limitations
Message Types and Editing:
Text messages: Use
edit_message(won't work on photo messages)Photo messages: Use
edit_message_caption(won't work on text-only messages)You cannot change a text message to a photo or vice versa
The bot can only edit messages it sent itself
Message Search: Only searches locally cached messages from current session (Telegram Bot API limitation)
Messages are cached in-memory during the current session
Cache is cleared when the server restarts
You can still edit messages from previous sessions if you know the message_id
Message Retrieval: Telegram Bot API doesn't provide a way to fetch arbitrary messages by ID
Bot Permissions: Bot must be channel admin with appropriate permissions:
Post messages
Edit messages
Delete messages
Edit Time Limit: Telegram has a 48-hour limit for editing messages
Rate Limits: Telegram enforces rate limits on bot API calls
Troubleshooting
"Telegram bot token is required" Error
Make sure you've set the TELEGRAM_BOT_TOKEN environment variable or configured it in your MCP client.
"Chat not found" Error
For public channels, ensure you use
@channelnameformatFor private channels, use numeric chat ID (e.g.,
-1001234567890)Verify the bot is added to the channel as an admin
"Not enough rights to send messages" Error
The bot needs admin permissions in the channel with:
Post messages
Edit messages
Delete messages
"Message can't be edited" Error
This usually means:
Wrong edit method for message type: Use
edit_message_captionfor photos,edit_messagefor textBot didn't send the message: Bots can only edit messages they sent themselves
Message is too old: Telegram has a 48-hour limit for editing messages
License
MIT License - See LICENSE file for details
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Add tests for new functionality
Ensure all tests pass
Submit a pull request
Resources
Support
For issues and questions:
GitHub Issues: Report a bug
MCP Discord: Join the community
Available Tools
8 toolstelegram_delete_messageADestructiveIdempotent
Delete a message from a Telegram channel.
Use this tool to permanently remove a message from a channel. The bot must have delete message permissions in the channel.
Args: channel_id: Channel username (e.g., '@mychannel') or numeric chat ID. message_id: The unique identifier of the message to delete. response_format: Response format. Options: 'json' for structured data, 'markdown' for human-readable text. Default is 'markdown'.
Returns: A dictionary containing success status, message_id, and operation status. If response_format='markdown', returns formatted text content.
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| message_id | Yes | ||
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate destructive and non-read-only. The description adds context about permanent removal, required bot permissions, and the return format (dictionary/markdown). No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is front-loaded with a clear purpose sentence. The Args/Returns sections are structured and helpful, though the first two sentences slightly repeat the same idea. Overall efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers prerequisites (permissions), parameter details, and return values. Given it's a simple delete operation with an output schema, it is adequately complete. It does not address error scenarios, but that is not necessary at this level.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides no descriptions (0% coverage), but the description thoroughly explains each parameter: channel_id format (username or numeric ID), message_id as unique identifier, and response_format options with default. This fully compensates for schema gaps.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states 'Delete a message from a Telegram channel' with a specific verb and resource. Distinguishes from sibling tools like publish and edit by focusing on deletion. No ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly instructs to 'Use this tool to permanently remove a message from a channel' and notes the required permission. However, it does not name alternative tools or explicitly state when not to use, so it lacks exclusion guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
telegram_edit_messageAIdempotent
Edit an existing TEXT message in a Telegram channel.
Use this tool to modify the content of a previously published TEXT message. IMPORTANT: This only works for text messages. If the message contains a photo, use edit_message_caption instead.
The bot must be the original sender of the message and have edit permissions.
Args: channel_id: Channel username (e.g., '@mychannel') or numeric chat ID. Must be the same channel where the original message was sent. message_id: The unique identifier of the message to edit. This is returned when you publish a message. new_text: The new text to replace the existing message content. Supports formatting based on parse_mode. parse_mode: Text formatting mode. Options: 'Markdown', 'HTML', or 'None'. Default is 'Markdown'. response_format: Response format. Options: 'json' for structured data, 'markdown' for human-readable text. Default is 'markdown'.
Returns: A dictionary containing message_id, chat_id, date, edit_date, text, and link. If response_format='markdown', returns formatted text content.
| Name | Required | Description | Default |
|---|---|---|---|
| new_text | Yes | ||
| channel_id | Yes | ||
| message_id | Yes | ||
| parse_mode | No | Markdown | |
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses the text-only limitation, original-sender permission requirement, and how response_format changes the return value. Annotations already note mutating but non-destructive and idempotent, and the description adds valuable context without contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Structured sections with Args and Returns, front-loaded warning about text-only limitation. Each sentence adds necessary information without redundancy, making it appropriately sized and well-organized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers permissions, text-only scope, all parameters, and return values including the markdown/json difference. Sibling distinction further completes the picture, making the description self-sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema coverage, the description fully compensates by explaining each parameter: channel_id (username or ID, same channel), message_id (returned at publish), new_text (formatting based on parse_mode), parse_mode (options/default), and response_format (options/default). This goes beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The opening sentence uses a specific verb and resource ('Edit an existing TEXT message in a Telegram channel') and immediately differentiates from the sibling tool by stating photo messages should use edit_message_caption instead. This makes the tool's scope unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly provides an alternative for photo messages (edit_message_caption) and states the bot must be the original sender with edit permissions. This gives clear when-to-use and when-not-to-use guidance, satisfying the highest bar.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
telegram_edit_message_captionAIdempotent
Edit the caption of an existing photo message in a Telegram channel.
Use this tool to modify the caption text of a previously published photo message. This only works for messages that contain media (photos, videos, etc.). You cannot change the photo itself, only the caption text. The bot must be the original sender of the message and have edit permissions.
Args: channel_id: Channel username (e.g., '@mychannel') or numeric chat ID. Must be the same channel where the original message was sent. message_id: The unique identifier of the photo message to edit. This is returned when you publish a photo. new_caption: The new caption text to replace the existing caption. Supports formatting based on parse_mode. Maximum 1024 characters. parse_mode: Caption formatting mode. Options: 'Markdown', 'HTML', or 'None'. Default is 'Markdown'. response_format: Response format. Options: 'json' for structured data, 'markdown' for human-readable text. Default is 'markdown'.
Returns: A dictionary containing message_id, chat_id, date, edit_date, caption, photo info, and link. If response_format='markdown', returns formatted text content.
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| message_id | Yes | ||
| parse_mode | No | Markdown | |
| new_caption | Yes | ||
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already signal idempotence and non-destructiveness, so the description adds value by disclosing the media-only constraint, inability to change the photo, and the requirement that the bot be the original sender with edit permissions. These are important behavioral nuances beyond what annotations convey. No contradiction with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with an opening purpose, a short 'use this' paragraph, and clear Args/Returns sections. It is slightly longer than strictly necessary but every sentence provides useful information, so the verbosity is earned. The front-loading of purpose and constraints is effective.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 5 parameters, no schema descriptions, and the presence of an output schema, the description covers all necessary aspects: prerequisites, limitations, parameter semantics, and return format. It even explains the response_format behavior. The tool is complex enough that this level of detail is warranted, and the description completes the picture beyond the annotated fields.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With schema description coverage at 0%, the description fully compensates by detailing every parameter: channel_id is given with examples and a constraint, message_id source is explained, new_caption includes max length and formatting support, parse_mode lists options with a default, and response_format is clarified. This adds substantial meaning beyond the bare schema types.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource: 'Edit the caption of an existing photo message in a Telegram channel.' It clearly differentiates from siblings like telegram_publish_photo (publishing) and telegram_edit_message (likely editing message text) by focusing on captions of media messages. The scope is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states when to use the tool ('modify the caption text of a previously published photo message'), explicitly limits usage to media-containing messages, and notes that the bot must be the original sender with edit permissions. It does not explicitly name an alternative tool for non-media messages, but the 'only works for media' phrasing implies when not to use it. This provides solid context without being overly verbose.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
telegram_get_channel_infoARead-onlyIdempotent
Get detailed information about a Telegram channel.
Use this tool to retrieve metadata and statistics about a channel where the bot is a member or admin.
Args: channel_id: Channel username (e.g., '@mychannel') or numeric chat ID. response_format: Response format. Options: 'json' for structured data, 'markdown' for human-readable text. Default is 'markdown'.
Returns: A dictionary containing id, title, username, type, description, invite_link, and member_count. If response_format='markdown', returns formatted text content.
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | ||
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare read-only, idempotent, and non-destructive behavior. The description adds valuable context beyond annotations: the bot membership/admin requirement and the response format behavior (json vs markdown). It does not cover error handling or rate limits, but for a read-only tool this is sufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured with an 'Args' and 'Returns' section. It is front-loaded with the purpose, and every sentence adds value without fluff. The formatting is easy to parse for an agent.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read-only tool with only two parameters, the description covers purpose, prerequisites, parameter semantics, and return format. It is complete enough for an agent to select and invoke the tool correctly without additional context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description fully compensates by explaining both parameters: channel_id accepts a username ('@mychannel') or numeric ID, and response_format accepts 'json' or 'markdown' with a default. This adds complete meaning beyond the bare schema definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states exactly what the tool does: 'Get detailed information about a Telegram channel.' It uses a specific verb ('Get') and resource ('channel info'), and clearly distinguishes it from sibling publish/edit/delete/search tools by focusing on retrieval rather than mutation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear usage context: 'Use this tool to retrieve metadata and statistics about a channel where the bot is a member or admin.' It implies the prerequisite (bot membership/admin) without explicitly naming alternatives, but the sibling tools are obviously for different operations, making the intended use clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
telegram_publish_messageA
Publish a message to a Telegram channel.
Use this tool to post new messages to a Telegram channel where the bot is an admin. The bot must have permission to post messages in the channel.
Args: channel_id: Channel username (e.g., '@mychannel') or numeric chat ID (e.g., '-1001234567890'). Use '@' prefix for public channels with username. text: The message text to publish. Supports Markdown or HTML formatting based on parse_mode. parse_mode: Text formatting mode. Options: 'Markdown', 'HTML', or 'None' for plain text. Default is 'Markdown'. disable_web_page_preview: If True, disables link preview for URLs in the message. Default is False. disable_notification: If True, sends the message silently (no notification to users). Default is False. response_format: Response format. Options: 'json' for structured data, 'markdown' for human-readable text. Default is 'markdown'.
Returns: A dictionary containing message_id, chat_id, date, text, and link. If response_format='markdown', returns formatted text content.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| channel_id | Yes | ||
| parse_mode | No | Markdown | |
| response_format | No | markdown | |
| disable_notification | No | ||
| disable_web_page_preview | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate a write/non-idempotent operation, but the description adds valuable context: bot admin requirement, parse_mode formatting behavior, effects of disable_web_page_preview and disable_notification, and response format differences. No contradictions with annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with an intro, usage note, Args section, and Returns section. Every sentence adds value, and there is no redundancy or fluff. It is appropriately sized for a 6-parameter tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is moderately complex and the schema provides no descriptions, yet the description covers purpose, prerequisites, every parameter, defaults, and return values. This makes the tool fully invocable without external documentation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description thoroughly explains all 6 parameters, including types, options, defaults, and the meaning of channel_id formats. This fully compensates for the schema gaps.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The first sentence clearly states the verb and resource: 'Publish a message to a Telegram channel.' It distinguishes from sibling tools like telegram_publish_photo by focusing on text messages and explicitly says 'post new messages.'
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly states when to use the tool ('Use this tool to post new messages to a Telegram channel where the bot is an admin') and gives a prerequisite (bot must have permission). It does not explicitly mention alternatives (e.g., for photos use telegram_publish_photo), but the context is clear enough.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
telegram_publish_photoA
Publish a photo to a Telegram channel with an optional caption.
Use this tool to post photos to a Telegram channel where the bot is an admin. The photo can include a text caption with formatting. The bot must have permission to post messages in the channel.
Args: channel_id: Channel username (e.g., '@mychannel') or numeric chat ID. photo: Photo to send. Can be: - File path to a local image file (e.g., '/path/to/image.jpg') - URL to a remote image (e.g., 'https://example.com/image.png') - Telegram file_id of a photo that exists on Telegram servers caption: Optional text caption for the photo. Supports Markdown or HTML formatting based on parse_mode. Maximum 1024 characters. parse_mode: Caption formatting mode. Options: 'Markdown', 'HTML', or 'None' for plain text. Default is 'Markdown'. disable_notification: If True, sends the photo silently (no notification to users). Default is False. response_format: Response format. Options: 'json' for structured data, 'markdown' for human-readable text. Default is 'markdown'.
Returns: A dictionary containing message_id, chat_id, date, caption, photo info, and link. If response_format='markdown', returns formatted text content.
| Name | Required | Description | Default |
|---|---|---|---|
| photo | Yes | ||
| caption | No | ||
| channel_id | Yes | ||
| parse_mode | No | Markdown | |
| response_format | No | markdown | |
| disable_notification | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover non-read-only and non-idempotent behavior. The description adds useful context: the bot must have admin permission, photo can be a path/URL/file_id, and return values include message_id and chat_id. It doesn't contradict annotations and enriches the behavioral model, though it omits details like error handling or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and well-structured, starting with a one-sentence summary, followed by a short usage context, then an Args list, and a Returns section. Every sentence provides useful information without redundancy, earning its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (6 parameters, varied input types, response_format options) and the presence of annotations and an output schema, the description covers prerequisites, parameter nuances, and return structure. It is complete enough for an agent to select and invoke the tool correctly without additional information.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully compensates by explaining every parameter in the 'Args' section. It clarifies accepted formats for channel_id (username or numeric ID) and photo (path, URL, file_id), gives max caption length, lists parse_mode options, and explains response_format. This adds significant meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Publish a photo to a Telegram channel with an optional caption,' which is a specific verb+resource statement. It clearly distinguishes from sibling tools like telegram_publish_message (text) and telegram_publish_photo_album (multiple photos) by focusing on a single photo.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states when to use this tool: 'post photos to a Telegram channel where the bot is an admin' and notes the permission requirement. It does not explicitly name alternatives or provide 'when-not' guidance, but the context is clear enough to differentiate it from siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
telegram_publish_photo_albumA
Publish multiple photos as an album (media group) to a Telegram channel.
Use this tool to post 2-10 photos in a single message as an album/gallery. Users can swipe through the photos. Each photo can have its own caption. The bot must have permission to post messages in the channel.
Args: channel_id: Channel username (e.g., '@mychannel') or numeric chat ID. photos: List of photo objects (2-10 items). Each photo object must contain: - photo (required): Photo to send. Can be: - File path to a local image file (e.g., '/path/to/image.jpg') - URL to a remote image (e.g., 'https://example.com/image.png') - Telegram file_id of a photo that exists on Telegram servers - caption (optional): Text caption for this specific photo. Maximum 1024 characters. - parse_mode (optional): Caption formatting mode ('Markdown', 'HTML', or 'None'). Default is 'Markdown' if not specified. disable_notification: If True, sends the album silently (no notification to users). Default is False. response_format: Response format. Options: 'json' for structured data, 'markdown' for human-readable text. Default is 'markdown'.
Returns: A dictionary containing: - album_id: Unique identifier for the media group - message_count: Number of photos in the album - messages: List of message details for each photo (message_id, caption, photo info, link) - first_message_id: ID of the first message in the album - chat_id: Channel chat ID If response_format='markdown', returns formatted text content.
Example: photos = [ { "photo": "https://example.com/photo1.jpg", "caption": "First photo caption", "parse_mode": "Markdown" }, { "photo": "/path/to/photo2.jpg", "caption": "Second photo caption" }, { "photo": "AgACAgIAAxkBAAIC...", # Telegram file_id "caption": "Third photo" } ]
| Name | Required | Description | Default |
|---|---|---|---|
| photos | Yes | ||
| channel_id | Yes | ||
| response_format | No | markdown | |
| disable_notification | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate readOnlyHint=false and destructiveHint=false, which are not contradicted. The description adds meaningful context: album behavior ('Users can swipe through the photos'), per-photo captions, and the permission prerequisite. It lacks details like idempotency or rate limits, but given annotation coverage the added context is adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is longer than typical but well-organized with Args, Returns, and an Example. Every sentence contributes value, and the structure makes information easy to scan. It could be slightly trimmed without losing meaning, but it's justified for a complex multi-parameter tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the absence of schema descriptions, the description is remarkably complete. It covers all parameters, return values, defaults, permission requirements, and provides a realistic example. No important aspect appears missing for an agent to use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description carries full burden. It compensates excellently: explains each parameter, including the photos array structure with required 'photo' and optional 'caption'/'parse_mode', their types, examples, defaults for disable_notification and response_format, and channel_id formats. Example usage clarifies photo sources (URL, path, file_id).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Publish multiple photos as an album (media group) to a Telegram channel.' It is distinct from siblings like telegram_publish_photo (single photo) and provides essential scope (2-10 photos).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says 'Use this tool to post 2-10 photos in a single message as an album/gallery,' establishing when it applies. It also notes the bot permission requirement. It doesn't explicitly name alternatives (e.g., 'for single photo use telegram_publish_photo'), but the sibling list and clarifying phrase 'multiple photos' make the use case clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
telegram_search_messagesARead-onlyIdempotent
Search for messages in a Telegram channel (from local cache ONLY).
⚠️ CRITICAL LIMITATIONS - READ CAREFULLY:
Session-Only Cache: This tool ONLY searches messages cached in the CURRENT SERVER SESSION.
Messages published/edited BEFORE the server started are NOT available
Cache is CLEARED when the server restarts
This is a Telegram Bot API limitation, not a bug
Cannot Retrieve Historical Messages: The Telegram Bot API does not provide methods to fetch arbitrary messages or search message history.
What IS Cached: ✅ Messages published via publish_message in current session ✅ Messages edited via edit_message in current session ✅ Photos published via publish_photo in current session ✅ Photo captions edited via edit_message_caption in current session
What is NOT Cached: ❌ Messages sent before server started ❌ Messages sent by other bots or users ❌ Messages sent when server was offline
You CAN Still: ✅ Edit messages from previous sessions if you have the message_id ✅ Delete messages from previous sessions if you have the message_id ✅ The message_id is returned when publishing messages - store it if needed later!
Args: channel_id: Channel username (e.g., '@mychannel') or numeric chat ID to search in. query: Search query string. Performs case-insensitive search in message text/caption. If None or empty, returns all cached messages for the channel. limit: Maximum number of results to return. Default is 10. Results are sorted by date (newest first). offset: Number of results to skip. Use for pagination. Default is 0. response_format: Response format. Options: 'json' for structured data, 'markdown' for human-readable text. Default is 'markdown'.
Returns: A dictionary containing: - messages: List of matching messages (may be empty if nothing cached) - count: Number of messages returned in this page - total: Total number of matching messages in cache - offset: Current offset value - limit: Current limit value - has_more: Boolean indicating if more results are available - next_offset: Offset value for the next page (if has_more is True) - query: The search query used - channel_id: The channel searched - status: Operation status If response_format='markdown', returns formatted text content.
Note: If you need to work with older messages, you must keep track of message_id values returned when publishing. There is no way to retrieve message_id for historical messages through the Telegram Bot API.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | No | ||
| offset | No | ||
| channel_id | Yes | ||
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses extensive behavioral traits: session-only cache, cache clearing on restart, Bot API limitations, what is/isn't cached, and the ability to edit/delete with message_id. This goes far beyond the annotations, which only indicate read-only and idempotent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Although lengthy, the description is well-structured with bolded warnings, bullet points, and dedicated sections for Args, Returns, and Notes. Every sentence provides actionable information, and the critical limitations are front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers all aspects: purpose, limitations, usage, parameters, return values, and practical notes. It is complete for a tool with complex caching constraints, and the output schema is described in sufficient detail.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite the schema having 0% description coverage, the description thoroughly explains every parameter: channel_id, query (case-insensitive, None/empty returns all), limit, offset (pagination), and response_format (json/markdown). This adds essential meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description begins with 'Search for messages in a Telegram channel (from local cache ONLY)' which is a specific verb+resource+scope. It clearly distinguishes this tool from siblings by emphasizing the local cache limitation and stating it cannot retrieve historical messages.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use the tool (only for session-cached messages) and when not to (historical messages). It references sibling tools like publish_message and edit_message, and advises storing message_id for later operations, providing clear usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
8 tool updates
v0.1.3- First observed
telegram_delete_message - First observed
telegram_edit_message - First observed
telegram_edit_message_caption - First observed
telegram_get_channel_info - First observed
telegram_publish_message - First observed
telegram_publish_photo - First observed
telegram_publish_photo_album - First observed
telegram_search_messages
TDQS
Scored across 8 tools
Each tool targets a distinct operation: publishing text, photos, albums; editing text vs captions; deleting; searching; and retrieving channel info. The overlap between edit_message and edit_message_caption is clearly resolved by their descriptions (text vs media). No two tools appear to do the same thing.
All tool names follow the consistent telegram_verb_noun pattern (publish_photo, edit_message_caption, get_channel_info). The use of snake_case is uniform, and the verb accurately reflects the action, making the set predictable and easy to navigate.
With 8 tools, the server is well-scoped for channel management: create (publish), read (get info, search), update (edit), and delete. The count is neither too thin nor too heavy, and each tool serves a clear purpose within the domain.
The server covers the core lifecycle for messages (publish, edit, delete, search) and channel info. However, it lacks support for other media types like video or documents, and search is limited to session-cached messages, which might be a notable gap for some use cases. Overall, the most essential operations are present.
Maintenance
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Manage Telegram drafts, media, schedules and publications from AI clients.
Run a Telegram channel from your AI agent. Posts go out through your own bot, not your account.
Agent communication platform for agent to agent messaging via MCP. Messages, channels, skills.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to send messages and interact with Telegram chats through MCP tools, with support for user management, conversation history, and bot command handling.1-
- FlicenseNot gradedqualityDmaintenanceEnables sending messages to Telegram channels via MCP protocol, integrating with AI assistants for automated messaging.7-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with Telegram accounts through MCP, supporting messaging, contacts, groups, media, and admin functions.4Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables users to read, search, and manage Telegram messages in channels, groups, and private chats through MCP tools.-