# Telegram Bot API MCP

> Telegram Bot API MCP connects your AI agent directly into Telegram, letting you treat it like a certified bot application. This lets you read incoming user messages, manage group members, delete content, and send rich media alerts—all without needing to open the native app or worry about complex APIs.

## Overview
- **Category:** talk-to-me
- **Price:** Free
- **Tags:** instant-messaging, bot-integration, push-notifications, automated-replies, group-management, media-distribution

## Description

This MCP turns any standard conversational window into a powerful messaging director. By authorizing your agent as a Telegram Bot, you bypass general client restrictions entirely. You gain operational control over chats: read incoming messages, check group member lists, and send structured alerts instantly. Need to update an old message or clean up spam? Your agent can edit existing text or delete unwanted posts outright. For media distribution, simply give it a URL, and your AI client handles sending photos and documents across the chat. This level of control over real-time messaging is exactly what Vinkius provides, letting you manage complex workflows that span outside traditional databases.

## Tools

### delete_chat_message
Permanently removes a message from a chat, whether it was sent by the bot or another user.

### forward_message
Sends an existing message from one Telegram chat to a completely different chat while keeping the original sender's information intact.

### get_chat_member
Pulls specific profile details about a single member within a chat.

### pin_chat_message
Marks an important message so it stays visible at the top of the conversation.

### unpin_chat_message
Removes a pin marker from a chat message, returning it to normal scrolling visibility.

### get_chat_details
Retrieves detailed information about any given chat, whether it's a user, group, or channel.

### get_bot_info
Gets basic operational details about the bot itself, like its unique ID and username.

### edit_message_text
Rewrites the text of a message that was already sent by the bot previously.

### list_chat_administrators
Generates a list of all users who currently hold administrator permissions in a specific group or channel.

### get_chat_member_count
Reports the precise total number of people belonging to a given chat.

### list_bot_updates
Pulls new messages and activity updates from users in real-time, acting like continuous long polling for fresh data.

### send_document_by_url
Transmits a file or document to the chat using only a public download link.

### send_text_message
Sends basic text content directly to any specified user or group.

### send_photo_by_url
Delivers an image file to the chat using a public HTTPS link.

## Prompt Examples

**Prompt:** 
```
Scan the bot updates, check for new interactions, and send a structured text message back to the latest user chat ID resolving their query.
```

**Response:** 
```
Interrogating 'list_bot_updates' securely natively...
Found 2 recent updates. Extracting newest payload context. Chat ID: 8472910.
User asks: 'Server Status'.
Dispatching resolution dynamically utilizing 'send_text_message'. Payload correctly executed and transmitted to the Telegram Chat.
```

**Prompt:** 
```
Send a markdown formatted message to the #engineering channel.
```

**Response:** 
```
Formatting payload with `send_message`...
Message "Deployment to production has started. **Status: Green**" sent successfully to `@engineering_alerts` (ID: -100123456).
```

**Prompt:** 
```
Fetch the last 5 messages from our customer support group.
```

**Response:** 
```
Calling Telegram API (`get_updates`)...
Retrieved 5 recent messages from Chat ID -100987654:
1. User44: 'Is the API down?'
2. AgentSmith: 'No, looking into it...'
3. User44: 'My token is failing.'
4. AgentSmith: 'Can you DM me your client ID?'
5. User12: 'I have the same issue.'
```

## Capabilities

### Read incoming messages and updates
The agent pulls recent communications from a chat, allowing it to analyze user queries or system alerts.

### Send formatted text and media alerts
You can send plain text messages, photos via URL, and documents using public links directly into any specified chat.

### Moderate group content
The agent can delete inappropriate user posts or edit the text of messages that were previously sent by the bot itself.

### Audit and manage groups
You can list who has administrative rights in a channel, check the total member count, or get details on any chat type.

## Use Cases

### Automating support triage after hours
A Tier 1 Support Engineer wants to know if the API is down. Instead of manually checking logs, they ask their agent to run `list_bot_updates`. The agent finds the recent messages and sends a structured reply via `send_text_message` confirming the status.

### Cleaning up group spam
A Community Manager spots inappropriate replies in a large public channel. They ask their AI client to delete the offending posts using `delete_chat_message`, keeping the main conversation flow clean and professional.

### Sending urgent deployment notices
A DevOps team needs to notify an on-call group of a build failure. They provide the link, and the agent executes `send_photo_by_url` immediately, pushing the critical image straight to Telegram.

### Auditing channel access
A Product Manager needs assurance that only certain leads can administer a private group. They use the tool to call `list_chat_administrators`, getting an immediate list of authorized users for review.

## Benefits

- You can stop manually checking chat logs. Using `list_bot_updates` lets your agent pull fresh messages instantly, so you never miss a key user query or status update.
- Media distribution is simple: instead of uploading files, just provide the URL and use tools like `send_photo_by_url` or `send_document_by_url`. The AI handles delivering it flawlessly.
- Need to correct an alert? Use `edit_message_text` to rewrite a previously sent message with updated data. It's better than deleting and resending, because the history stays clean.
- Group management becomes auditable. You can use `list_chat_administrators` to instantly verify who has control over sensitive channels, or `get_chat_member_count` for quick audience sizing.
- The system is resilient enough that you can handle complex interactions by using the agent to read messages (`list_bot_updates`) and then reply with a structured confirmation via `send_text_message`.

## How It Works

The bottom line is you get full operational control over Telegram messaging, letting your AI agent act like a built-in bot.

1. First, provision the generic Telegram connectivity structure within your Vinkius limits module.
2. Next, go to @BotFather in Telegram to request a new bot token and assign that unique key as your MCP authorization credential.
3. Finally, instruct your AI client: 'Check for new messages mentioning X, then reply to their chat ID with Y.' Your agent handles the rest.

## Frequently Asked Questions

**How does list_bot_updates work with Telegram Bot API MCP?**
list_bot_updates pulls all new messages and activity updates from users, acting like continuous polling. Your agent receives a structured payload of the latest interactions instantly.

**Can I send files using the Telegram Bot API MCP?**
Yes, you can use `send_document_by_url` or `send_photo_by_url`. These tools require a public URL and handle streaming the media directly into any chat.

**What if I need to change an old message?**
You use the `edit_message_text` tool. This allows your agent to rewrite the text of a specific message previously sent by the bot, keeping it visible in the chat history.

**How do I check group permissions using Telegram Bot API MCP?**
You run `list_chat_administrators` to generate an immediate list of everyone who has admin rights. This is useful for compliance checks and governance.

**Is the Telegram Bot API MCP better than just posting a web hook?**
Yes, because this MCP gives your agent operational control over the messages—it can read updates (`list_bot_updates`) and *reply* or *moderate* content using tools like `send_text_message`.