Fast MCP Telegram
The Fast MCP Telegram Server integrates Telegram with AI assistants and applications, enabling messaging, search, chat management, and direct MTProto API access.
Send messages (
send_message): Send text with Markdown/HTML formatting, file attachments (URLs or local paths), replies, and forum topic support.Edit messages (
edit_message): Modify the text of existing messages you have edit rights to.Message a phone number (
send_message_to_phone): Send messages directly to a phone number, with optional temporary contact creation and cleanup.Search messages globally (
search_messages_globally): Search across all chats using multi-term queries, with filters for date ranges, chat type, and public status.Read & search messages in a chat (
get_messages): Retrieve messages in 5 modes — browse latest, search by text, fetch by IDs, load replies/comments, or explore forum topics/threads.Find chats/users/groups/channels (
find_chats): Discover entities by name, username, or phone number, with filtering by folder, date, and chat type.Get chat/profile info (
get_chat_info): Retrieve full profile metadata, member counts, forum topics, and more.Direct MTProto API access (
invoke_mtproto): Call any low-level Telegram API method with entity resolution and safety guardrails.
Additional highlights:
Multi-user support with per-user Bearer tokens and session isolation (optional ACL)
Dual transport: local stdio or remote HTTP with a web setup interface
Voice transcription for Premium accounts
Bot token authentication as an alternative to phone login
SSRF protection for file attachments and album support
Provides tools to interact with Telegram, including sending messages, searching chats, retrieving messages, and direct access to the Telegram API via MTProto bridge.
Telegram MCP Server — Model Context Protocol (MCP) gateway for Telegram. 8 context-efficient tools, multi-tenant, MTProto bridge.
Try the Demo
Scan the QR code from Telegram mobile (Settings → Devices → Scan QR) — no phone typing, no OTP, no 2FA. Or enter your phone number as fallback.
Copy your Bearer token from the success page
Then choose your path:
MCP Client (AI assistants)
From the setup page, download the
mcp.jsonfileAdd the server to your AI client and ask: "send hello to my saved messages in telegram"
Direct API (curl)
Run the command below (replace TOKEN with yours):
curl -X POST "https://tg-mcp.l1979.ru/mtproto-api/messages.SendMessage" \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"params": {"peer": "me", "message": "Hello!"}}'
Related MCP server: mcp-telegram
How It Works
This server sits between your AI agent and Telegram's API:
Your agent → MCP/HTTP → this server → MTProto → TelegramWhat it does: Authenticates you with Telegram (QR or phone/bot token), exposes 8 AI-friendly tools instead of 80+ micro-APIs, and bridges raw MTProto for power users. Multi-tenant — one server, many users, isolated sessions.
Features
Feature | Description |
:building_construction: Dual Transport | Stdio for local MCP clients, HTTP for remote deploys ( |
:closed_lock_with_key: Multi-User Authentication | Shared |
:dart: AI-Optimized | 8 consolidated tools vs 80+ micro-tools — context-efficient design, LLM-friendly API, MCP ToolAnnotations |
:globe_with_meridians: HTTP-MTProto Bridge | Direct curl access to any Telegram API method with entity resolution and safety guardrails |
:shield: Session ACL | Opt-in per-principal limits on |
:tv: QR & Web Setup | Scan QR from Telegram mobile for instant auth (no phone/OTP/2FA) or use phone/code/2FA fallback — live at |
:label: One Agent, Multiple Accounts | Optional |
:rocket: MTProto Proxy Support | Connect via MTProto proxy with automatic Fake TLS (EE prefix) and standard proxy detection |
:card_file_box: Unified Session Management | Single configuration system for setup and server; per-token session files on shared multi-user hosts |
:cloud: S3 Session Storage | Store sessions in S3-compatible object storage for ephemeral hosted deployments (Smithery, Fly.io, Railway) |
:mag_right: Intelligent Search | Global & per-chat message search with multi-query support and intelligent deduplication |
:mag: Unified Message API | Single |
:speech_balloon: Universal Replies | Get replies from channel posts, forum topics, or any message with one parameter |
:busts_in_silhouette: Smart Contact Discovery | Search users, groups, channels with uniform entity schemas, forum detection, profile enrichment |
:file_folder: Folder Filtering | Filter chats by dialog folder (archived, custom folders) with integer ID or name matching |
:envelope: Advanced Messaging | Send, edit, reply, post to forum topics, formatting, file attachments, and phone number messaging |
:paperclip: Secure File Handling | Rich media sharing with SSRF protection, size limits, album support, optional HTTP attachment streaming |
:outbox_tray: Inline File Uploads | Data: URI (base64) file uploads in |
:microphone: Voice Transcription | Automatic speech-to-text for Premium accounts with parallel processing and polling |
:zap: High Performance | Async operations, parallel queries, and memory-conscious batching |
:shield: Production Reliability | Auto-reconnect, configurable logging, comprehensive error handling |
Quick Start
1. Install and authenticate
Quickest path (remote server): Open /setup → scan QR → copy token (see Try the Demo).
CLI path (local stdio): Run fast-mcp-telegram-setup once to create a Telegram session — then fast-mcp-telegram serves it:
uvx --from fast-mcp-telegram fast-mcp-telegram-setup \
--api-id="your_api_id" \
--api-hash="your_api_hash" \
--phone-number="+123456789"Bot token alternative (no phone, no OTP):
Set BOT_API_TOKEN instead of --phone-number. See Installation Guide.
2. Configure MCP Client
stdio mode (local): Add to your MCP client config (e.g. claude_desktop_config.json) — stdio (standard input/output) is the default transport for local MCP clients:
{
"mcpServers": {
"telegram": {
"command": "uvx",
"args": ["fast-mcp-telegram"],
"env": {
"API_ID": "your_api_id",
"API_HASH": "your_api_hash"
}
}
}
}http-auth mode (remote): Add to your MCP client config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"telegram": {
"url": "https://tg-mcp.l1979.ru/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}Get your token by scanning the QR code on the setup page or see Installation Guide for deploying your own server.
3. Start Using
{"tool": "search_messages_globally", "params": {"query": "hello", "limit": 5}}
{"tool": "get_messages", "params": {"chat_id": "me", "limit": 10}}
{"tool": "send_message", "params": {"chat_id": "me", "message": "Hello!"}}Deploy to Remote Server
Deploy your own MCP server on a VDS — see Installation Guide for step-by-step instructions.
Available Tools
Tool | Purpose | Key Features |
| Search across all chats | Multi-term queries, date filtering, chat type filtering |
| Unified message retrieval | Search/browse, read by IDs, get replies (posts/topics/messages), date filtering in all modes |
| Send new message | File attachments (URLs/local/data URIs), classic formatting (markdown/html), |
| Edit existing message | Classic or |
| Find users/groups/channels | Multi-term search, contact discovery, folder filtering, username/phone lookup |
| Get detailed profile info | Member counts, bio/about, online status, forum topics, common groups, enriched data |
| Message phone numbers | Auto-contact management, optional cleanup, file support (URLs/data URIs), |
| Direct Telegram API (power user) | Raw MTProto methods, entity resolution, safety guardrails — see MTProto Bridge |
See Tools Reference for detailed documentation with examples.
Documentation
Installation Guide - Local setup and remote server deployment
Tools Reference - Complete tools documentation
MTProto Bridge - Direct API access via curl
Contributing - Guidelines for contributors
Security - Security features and best practices
Telemetry
Anonymous tool telemetry since v0.30.1 — heartbeat every 6h, no credentials or message content collected. Opt out with DO_NOT_TRACK=1. See ADR 0005.
Auth flow telemetry since v0.38.0 — atomic events during setup (phone, QR, bot token, reauthorize). Buffered flush on flow completion. See ADR 0008.
License
MIT License - see LICENSE
mcp-name: io.github.alexeyleshchenko/fast-mcp-telegram
Available Tools
8 toolsedit_messageEdit messageADestructiveIdempotentInspect
Replace the text of an existing message in a Telegram chat. Only works on messages sent by the authenticated account. Cannot edit media or other message attributes — text only. Success: dict with message_id, date, chat, text, status='edited', and edit_date. Error: dict with ok=false and error string (e.g. message not found or not editable). Use edit_message to update a previously sent message; use send_message to create new ones. Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | Target chat: numeric id (e.g. -100…), username without @, or 'me' for Saved Messages. | |
| message_id | Yes | Message id in this chat to edit (from get_messages or Telegram). | |
| message | Yes | Message text. When sending files, used as caption. | |
| parse_mode | No | 'markdown', 'html', or 'auto' (detect from content). Default is 'auto'. | auto |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | No | |
| error | No | |
| operation | No | |
| code | No | |
| params | No | |
| exception | No | |
| action | No | |
| error_code | No | |
| message_id | No | |
| date | No | |
| chat | No | |
| text | No | |
| status | No | |
| sender | No | |
| reply_markup | No | |
| edit_date | No | |
| topic_id | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds significant context beyond the annotations: it explains the tool is destructive (edits existing message), idempotent (re-editing same text yields same result), and mentions that it only works on own messages. It also describes the success and error return formats. The annotations already indicate destructiveHint and idempotentHint, but the description elaborates on what that means in practice.
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 front-loaded with the core purpose. It is structured logically: what it does, constraints, success/error outputs, usage guidance, and a link to full docs. Every sentence adds value without redundancy.
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 that there is no explicit output schema provided, the description compensates by detailing return values and error formats. It covers all key aspects: constraints, intended usage, output structure, error handling, and a reference link. This is fully sufficient for an agent to understand and 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?
The input schema has 100% description coverage with clear descriptions for each of the 4 parameters, including enums and defaults. The tool description does not add any additional parameter-level meaning beyond what the schema already provides, so the baseline score of 3 is appropriate.
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 that the tool replaces the text of an existing message in a Telegram chat, specifying it only works on messages sent by the authenticated account and cannot edit media or other attributes. It distinguishes itself from sibling tools like send_message by explicitly saying 'Use edit_message to update a previously sent message; use send_message to create new ones.'
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 tells when to use this tool (to update a previously sent message) and when to use send_message (to create new ones). It does not provide explicit when-not-to-use scenarios beyond the stated constraints, but those constraints (only own messages, text only) are clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
find_chatsFind chatsARead-onlyIdempotentInspect
Find users/groups/channels by name, username, or phone. Global search (query required) searches all Telegram; with min_date, max_date, or filter, search uses dialog list or a named filter; include_peers filters use last-activity from GetPeerDialogs; flag-based filters use dialog list dates. Success: dict with key chats (list of chat objects). Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Name, username (no @), phone (+country…), or comma-separated multi-queries. Required for global search unless you use min_date/max_date or folder alone. | |
| limit | No | Maximum chats to return (recommended 50 or less). | |
| chat_type | No | Comma-separated chat kinds: private, bot, group, channel. Case-insensitive; extra spaces allowed. | |
| public | No | If true, prefer chats with a public username; if false, without. Does not apply to private DMs. Omit to skip this filter. | |
| min_date | No | Inclusive minimum date filter (ISO 8601 date or datetime). Omit for no lower bound. | |
| max_date | No | Inclusive maximum date filter (ISO 8601 date or datetime). Omit for no upper bound. | |
| folder | No | Telegram folder name (case-insensitive exact match after normalization). In Telegram's UI these are called folders; internally they are "dialog filters" — saved filter presets that group chats by custom criteria (pinned, unread, business, etc.). See Filters-vs-Folders.md for the technical distinction. |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | No | |
| error | No | |
| operation | No | |
| code | No | |
| params | No | |
| exception | No | |
| action | No | |
| error_code | No | |
| chats | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate read-only and idempotent behavior. The description adds behavioral details: search mode depends on parameters, success returns a dict with 'chats' key. 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 concise (3-4 sentences), front-loaded with the main action, and includes essential behavioral notes without redundancy.
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 7 parameters, different search modes, and an output schema referenced, the description adequately explains behavior and parameter roles, making it complete for an agent to use 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 coverage is 100% with parameter descriptions. The description adds value by explaining how parameters affect search mode but doesn't provide new info beyond schema for individual parameters.
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 finds users/groups/channels by name, username, or phone, distinguishing it from sibling tools like search_messages_globally which search messages. The verb 'Find' and resource 'chats' are specific and 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 explains when to use global search vs dialog list based on parameters (query required for global, dates/folder for dialog list). It provides context for parameter combinations but does not explicitly exclude alternative tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_chat_infoGet chat infoARead-onlyIdempotentInspect
Load profile and metadata for one user, bot, group, or channel. Success: info dict; forum chats may include topics up to topics_limit. Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | Target chat: numeric id (e.g. -100…), username without @, or 'me' for Saved Messages. | |
| topics_limit | No | Max forum topics to list when the chat is a forum. |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | No | |
| error | No | |
| operation | No | |
| code | No | |
| params | No | |
| exception | No | |
| action | No | |
| error_code | No | |
| id | No | |
| title | No | |
| username | No | |
| first_name | No | |
| last_name | No | |
| phone | No | |
| is_forum | No | |
| is_channel | No | |
| is_group | No | |
| is_user | No | |
| is_bot | No | |
| participants_count | No | |
| topics | No | |
| topics_has_more | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare read-only, idempotent, and open-world behavior. The description adds that the result is an info dict and that forum chats may include topics up to the specified limit, providing some additional behavioral context. However, it does not disclose error handling, permissions, 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 three sentences: the first states the core purpose, the second summarizes success output and special forum behavior, and the third provides a documentation link. It is front-loaded, efficient, and free of redundant content.
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 two-parameter tool with high schema coverage, full annotations, and an existing output schema, the description is sufficiently complete. It covers the purpose, return type, and special forum behavior without needing to explain return values in detail. The documentation link also supplements any missing specifics.
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 coverage is 100%, giving a baseline of 3. The description adds meaning by specifying that the target can be a user, bot, group, or channel, which clarifies the chat_id parameter domain. It also reinforces the topics_limit behavior for forums, going slightly beyond the schema descriptions.
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 uses a specific verb ('Load') and identifies the resource ('profile and metadata for one user, bot, group, or channel'), making the tool's function explicit. It clearly distinguishes from siblings like get_messages and find_chats by specifying it targets a single chat entity.
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 implies when to use the tool (when you need profile/metadata for a specific chat) but does not explicitly mention alternatives or when not to use it. No exclusions or references to sibling tools are provided, so guidance is only implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_messagesGet messages in chatARead-onlyIdempotentInspect
Read or search messages in one chat: browse latest, search text, fetch by ids, or load replies to a message (comments, forum topics, threads). Do not combine message_ids with query or reply_to_id. Success: messages, has_more, optional total_count and discussion fields. Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | Target chat: numeric id (e.g. -100…), username without @, or 'me' for Saved Messages. | |
| query | No | Search within this chat only; comma-separated terms. Omit to browse latest or use message_ids / reply_to_id modes. | |
| message_ids | No | Exact message ids to fetch. Mutually exclusive with query and reply_to_id. | |
| reply_to_id | No | Anchor message id: channel post id, forum topic_id from get_chat_info, or a message id for direct replies. Use with thread_scope. | |
| thread_scope | No | Only with reply_to_id. auto: full forum topic (topic_id) or channel comment thread via getReplies; else direct replies. full: nested branch under a message id (forum in-topic uses search window, not whole topic); supergroup threads use search top_msg_id. direct: immediate replies only. | auto |
| limit | No | Maximum messages to return (recommended 50 or less). | |
| min_date | No | Inclusive minimum date filter (ISO 8601 date or datetime). Omit for no lower bound. | |
| max_date | No | Inclusive maximum date filter (ISO 8601 date or datetime). Omit for no upper bound. | |
| auto_expand_batches | No | Extra search batches to run when filters narrow results. Higher values may return more matches at the cost of latency. | |
| include_total_count | No | If true, response may include total_count where supported (per-chat search; ignored for global search). |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | No | |
| error | No | |
| operation | No | |
| code | No | |
| params | No | |
| exception | No | |
| action | No | |
| error_code | No | |
| messages | No | |
| has_more | No | |
| total_count | No | |
| _warning | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and idempotentHint=true, so the description's extra constraints (mutual exclusivity, output fields) add useful but not critical context. No contradictions.
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?
Three sentences front-loading purpose and modes, with a link to full docs. Efficient but could be slightly more streamlined.
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 all modes, constraints, and output expectations. Has output schema and documentation link. For a tool with 10 parameters and multiple modes, it provides sufficient guidance.
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 100%, so each parameter is already documented. The description adds value by explaining usage modes and mutual exclusivity, going beyond raw schema descriptions.
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?
Description clearly states it reads or searches messages in a chat, listing specific modes (browse latest, search text, fetch by ids, load replies). Distinguishes from sibling 'search_messages_globally' by focusing on a single chat.
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 states not to combine message_ids with query or reply_to_id, and mentions successful output fields. Provides a documentation link for more details. Could be more direct about when to use siblings, but context is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
invoke_mtprotoInvoke MTProtoADestructiveInspect
Low-level Telegram API (MTProto) invoke for methods not wrapped by other tools. Dangerous methods require allow_dangerous=true. Success: API result dict or normalized error. Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md
| Name | Required | Description | Default |
|---|---|---|---|
| method_full_name | Yes | Telegram API method, e.g. "messages.GetHistory" or "users.GetFullUser" (normalization applied). | |
| params_json | Yes | JSON object string of TL parameters as in Telegram API docs; nested TL uses "_": "typeName" discriminator. | |
| allow_dangerous | No | If false, destructive methods (e.g. deletes) are blocked. Set true only when intended. | |
| resolve | No | If true, resolve string/int peer-like fields to TL Input* entities before invoke. |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | No | |
| error | No | |
| operation | No | |
| code | No | |
| params | No | |
| exception | No | |
| action | No | |
| error_code | No | |
| _ | No | |
| id | No | |
| date | No | |
| users | No | |
| chats | No | |
| messages | No | |
| result | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate openWorldHint and destructiveHint. The description adds useful behavioral context: destructive methods are blocked unless allow_dangerous=true, and success returns either an API result dict or normalized error. 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?
Three concise sentences, each earning its place: purpose, safety/success behavior, and a documentation link. Information is front-loaded and free of fluff.
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?
With an output schema present and annotations covering open-world/destructive traits, the description fully addresses necessary context for a low-level fallback tool. It clearly states the tool's scope, safety guardrail, and result format, plus a link to full docs.
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 already covers all parameters with descriptions, so baseline is 3. The description adds context beyond the schema by connecting allow_dangerous to the dangerous-methods mechanism, enhancing the agent's understanding of when and how to set it.
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?
Description clearly states it invokes low-level Telegram MTProto methods not wrapped by other tools, distinguishing it from the sibling high-level tools. The verb 'invoke' and resource 'MTProto' are specific and 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?
Explicitly says to use for methods not wrapped by other tools, positioning it as a fallback. It also provides critical guidance about dangerous methods requiring allow_dangerous=true, which helps the agent decide when this tool is appropriate versus safer alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_messages_globallySearch messages globallyARead-onlyIdempotentInspect
Search all Telegram chats at once (not scoped to one chat). Comma-separated query terms; optional filters by date, chat kind, and public username. Success: message list and metadata dict. Global search ignores include_total_count. Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search terms, comma-separated for multiple terms (OR-style global search). Required. | |
| limit | No | Maximum messages to return (recommended 50 or less). | |
| min_date | No | Inclusive minimum date filter (ISO 8601 date or datetime). Omit for no lower bound. | |
| max_date | No | Inclusive maximum date filter (ISO 8601 date or datetime). Omit for no upper bound. | |
| chat_type | No | Comma-separated chat kinds: private, bot, group, channel. Case-insensitive; extra spaces allowed. | |
| public | No | If true, prefer chats with a public username; if false, without. Does not apply to private DMs. Omit to skip this filter. | |
| auto_expand_batches | No | Extra search batches to run when filters narrow results. Higher values may return more matches at the cost of latency. | |
| include_total_count | No | If true, response may include total_count where supported (per-chat search; ignored for global search). |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | No | |
| error | No | |
| operation | No | |
| code | No | |
| params | No | |
| exception | No | |
| action | No | |
| error_code | No | |
| messages | No | |
| has_more | No | |
| total_count | No | |
| _warning | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses a non-obvious behavior (global search ignores include_total_count) and states the success return shape ('message list and metadata dict'). This adds context beyond the readOnly/idempotent annotations. No contradictions exist with the 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?
Three concise sentences front-load the core purpose, followed by key search behavior and a documentation link. Every sentence earns its place with no redundancy or fluff.
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 8-parameter schema with full descriptions, the description covers global scope, return format, and a behavioral caveat, plus a documentation link for deeper reference. It's sufficiently complete for an agent to select and invoke the tool correctly without needing 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?
Schema coverage is 100% with rich parameter descriptions, so the baseline is 3. The description restates query semantics ('Comma-separated query terms') and summarizes filter options, but doesn't add significant new parameter details beyond what the schema already provides. The include_total_count caveat is a small extra.
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 action ('Search all Telegram chats at once') and resource (messages across all chats). The parenthetical 'not scoped to one chat' explicitly differentiates it from sibling tools like get_messages, giving it a distinct and unambiguous purpose.
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?
It implies use when needing cross-chat search by stating 'Search all Telegram chats at once' and contrasting with scoped search. It also provides a specific behavioral caveat ('Global search ignores include_total_count'). However, it doesn't explicitly name alternative tools for single-chat search, so the guidance is clear but not fully explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_messageSend messageADestructiveInspect
Send text and optional file attachments to a Telegram chat. Supports reply-to (including forum topics and channel discussion groups), auto-detected or explicit parse_mode (markdown/html), and file attachments as http(s) URLs, local paths, or data: URIs. When files are provided, the message text becomes a caption. For channel posts with reply_to_id, automatically posts in the linked discussion group. Success: dict with message_id, date, chat, text, status='sent', and sender info. Error: dict with ok=false and error string. Use send_message to create new messages; use edit_message to modify existing ones. Use send_message_to_phone when targeting a phone number instead of a chat_id. Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | Target chat: numeric id (e.g. -100…), username without @, or 'me' for Saved Messages. | |
| message | Yes | Message text. When sending files, used as caption. | |
| reply_to_id | No | Telegram message id to reply to. For forums, topic root id; for channel posts, post id (may create a comment). Omit for a new top-level message. | |
| parse_mode | No | 'markdown', 'html', or 'auto' (detect from content). Default is 'auto'. | auto |
| files | No | List of attachment URLs, local paths, or data URIs (one or more strings). data: URIs (data:<mime>;base64,<payload>) work in all server modes; local paths work in stdio mode only. |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | No | |
| error | No | |
| operation | No | |
| code | No | |
| params | No | |
| exception | No | |
| action | No | |
| error_code | No | |
| message_id | No | |
| date | No | |
| chat | No | |
| text | No | |
| status | No | |
| sender | No | |
| reply_markup | No | |
| edit_date | No | |
| topic_id | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate destructiveHint=true and openWorldHint=true. The description adds valuable behavioral context: auto-detected parse_mode, file attachment support (URLs, paths, data URIs), reply-to behavior for forums and channel discussion groups, and the outcome format (success/error dicts). 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 information-dense but not overly verbose. It front-loads the main action and then logically organizes supporting details. Slightly longer than necessary but 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?
Given the tool's complexity (5 parameters, enum, multiple modes) and the presence of an output schema that documents return values, the description covers all key behavioral aspects, usage alternatives, and edge cases (channel posts, forum topics). It also references 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?
All 5 parameters are documented in the schema with detailed descriptions (100% coverage). The description adds extra context, such as the interaction between reply_to_id and channel posts, and file type restrictions. This goes beyond the schema, meriting a score above baseline 3.
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 starts with 'Send text and optional file attachments to a Telegram chat,' clearly stating the action and target. It explicitly distinguishes from siblings by mentioning edit_message for modifications and send_message_to_phone for targeting phone numbers.
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?
Provides explicit guidance: 'Use send_message to create new messages; use edit_message to modify existing ones. Use send_message_to_phone when targeting a phone number instead of a chat_id.' Also explains behavior for channel posts with reply_to_id.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_message_to_phoneSend message to phoneADestructiveInspect
Send to a phone number: may create a temporary contact, then send text or files. Success: send result plus contact_was_new / contact_removed when applicable. Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md
| Name | Required | Description | Default |
|---|---|---|---|
| phone_number | Yes | E.164 phone number with country code, e.g. +1234567890 (must be on Telegram). | |
| message | Yes | Message text. When sending files, used as caption. | |
| first_name | No | First name when creating a temporary contact. | Contact |
| last_name | No | Last name when creating a temporary contact. | Name |
| remove_if_new | No | If true, delete the contact after send when it was created only for this send. | |
| reply_to_msg_id | No | Reply to this message id in the target chat after resolve. | |
| parse_mode | No | 'markdown', 'html', or 'auto' (detect from content). Default is 'auto'. | auto |
| files | No | List of attachment URLs, local paths, or data URIs (one or more strings). data: URIs (data:<mime>;base64,<payload>) work in all server modes; local paths work in stdio mode only. |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | No | |
| error | No | |
| operation | No | |
| code | No | |
| params | No | |
| exception | No | |
| action | No | |
| error_code | No | |
| message_id | No | |
| date | No | |
| chat | No | |
| text | No | |
| status | No | |
| sender | No | |
| reply_markup | No | |
| edit_date | No | |
| topic_id | No | |
| phone_number | No | |
| contact_was_new | No | |
| contact_removed | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide destructiveHint and openWorldHint. The description adds context about creating temporary contacts and returning contact_was_new/contact_removed, which are side effects beyond annotations. However, it does not detail error cases or all behavioral nuances.
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?
Two sentences plus a reference link. Information is front-loaded: first sentence states the core purpose. Every word serves a purpose; no redundancy.
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 (8 parameters, output schema exists), the description covers the high-level flow and return values. It relies on the schema for parameter details, which is acceptable, but could briefly mention interaction between parameters like files and message.
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 coverage is 100%, so the schema documents all parameters thoroughly. The description provides overall flow context but does not add additional meaning to individual parameters beyond what the schema already offers.
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 action ('Send') and the resource ('to a phone number'), and distinguishes it from siblings like 'send_message' by specifying the target is a phone number rather than a chat ID. It also mentions creating temporary contacts, which is specific.
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 implies usage for sending to phone numbers but does not explicitly compare with siblings or provide when-to-use vs when-not-to-use guidance. The link to full documentation exists but the description itself lacks direct usage guidelines.
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.
1 tool update
v0.37.0- Added
search_messages_globally
1 tool update
- Removed
search_messages_globally
8 tool updates
v0.36.0- Changed
edit_message3 fields changed- removed
Output schema / additionalPropertiesRemoved value: -true - added
Output schema / descriptionAdded value: +"Return type for ``send_message`` and ``edit_message``." - added
Output schema / propertiesAdded value: +{ + "action": { + "type": "string" + }, + "chat": { + "additionalProperties": true, + "type": "object" + }, + "code": { + "type": "integer" + }, + "date": { + "type": "string" + }, + "edit_date": { + "type": "string" + }, + "error": { + "type": "string" + }, + "error_code": { + "type": "string" + }, + "exception": { + "additionalProperties": true, + "type": "object" + }, + "message_id": { + "type": "integer" + }, + "ok": { + "type": "boolean" + }, + "operation": { + "type": "string" + }, + "params": { + "additionalProperties": true, + "type": "object" + }, + "reply_markup": { + "additionalProperties": true, + "type": "object" + }, + "sender": { + "additionalProperties": true, + "type": "object" + }, + "status": { + "type": "string" + }, + "text": { + "type": "string" + }, + "topic_id": { + "type": "integer" + } +}
- Changed
find_chats3 fields changed- removed
Output schema / additionalPropertiesRemoved value: -true - added
Output schema / descriptionAdded value: +"Return type for ``find_chats``." - added
Output schema / propertiesAdded value: +{ + "action": { + "type": "string" + }, + "chats": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "code": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "error_code": { + "type": "string" + }, + "exception": { + "additionalProperties": true, + "type": "object" + }, + "ok": { + "type": "boolean" + }, + "operation": { + "type": "string" + }, + "params": { + "additionalProperties": true, + "type": "object" + } +}
- Changed
get_chat_info3 fields changed- removed
Output schema / additionalPropertiesRemoved value: -true - added
Output schema / descriptionAdded value: +"Return type for ``get_chat_info``." - added
Output schema / propertiesAdded value: +{ + "action": { + "type": "string" + }, + "code": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "error_code": { + "type": "string" + }, + "exception": { + "additionalProperties": true, + "type": "object" + }, + "first_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_bot": { + "type": "boolean" + }, + "is_channel": { + "type": "boolean" + }, + "is_forum": { + "type": "boolean" + }, + "is_group": { + "type": "boolean" + }, + "is_user": { + "type": "boolean" + }, + "last_name": { + "type": "string" + }, + "ok": { + "type": "boolean" + }, + "operation": { + "type": "string" + }, + "params": { + "additionalProperties": true, + "type": "object" + }, + "participants_count": { + "type": "integer" + }, + "phone": { + "type": "string" + }, + "title": { + "type": "string" + }, + "topics": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "topics_has_more": { + "type": "boolean" + }, + "username": { + "type": "string" + } +}
- Changed
get_messages3 fields changed- removed
Output schema / additionalPropertiesRemoved value: -true - added
Output schema / descriptionAdded value: +"Return type for ``search_messages_globally`` and ``get_messages``." - added
Output schema / propertiesAdded value: +{ + "_warning": { + "type": "string" + }, + "action": { + "type": "string" + }, + "code": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "error_code": { + "type": "string" + }, + "exception": { + "additionalProperties": true, + "type": "object" + }, + "has_more": { + "type": "boolean" + }, + "messages": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "ok": { + "type": "boolean" + }, + "operation": { + "type": "string" + }, + "params": { + "additionalProperties": true, + "type": "object" + }, + "total_count": { + "type": "integer" + } +}
- Changed
invoke_mtproto3 fields changed- removed
Output schema / additionalPropertiesRemoved value: -true - added
Output schema / descriptionAdded value: +"Return type for ``invoke_mtproto``.\n\nThe success payload is a JSON-safe dict whose shape depends on the\nTelegram API method invoked. Common top-level fields are listed here;\neverything else passes through as-is." - added
Output schema / propertiesAdded value: +{ + "_": { + "type": "string" + }, + "action": { + "type": "string" + }, + "chats": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "code": { + "type": "integer" + }, + "date": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "error_code": { + "type": "string" + }, + "exception": { + "additionalProperties": true, + "type": "object" + }, + "id": { + "type": "integer" + }, + "messages": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "ok": { + "type": "boolean" + }, + "operation": { + "type": "string" + }, + "params": { + "additionalProperties": true, + "type": "object" + }, + "result": { + "additionalProperties": true, + "type": "object" + }, + "users": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + } +}
- Changed
search_messages_globally3 fields changed- removed
Output schema / additionalPropertiesRemoved value: -true - added
Output schema / descriptionAdded value: +"Return type for ``search_messages_globally`` and ``get_messages``." - added
Output schema / propertiesAdded value: +{ + "_warning": { + "type": "string" + }, + "action": { + "type": "string" + }, + "code": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "error_code": { + "type": "string" + }, + "exception": { + "additionalProperties": true, + "type": "object" + }, + "has_more": { + "type": "boolean" + }, + "messages": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "ok": { + "type": "boolean" + }, + "operation": { + "type": "string" + }, + "params": { + "additionalProperties": true, + "type": "object" + }, + "total_count": { + "type": "integer" + } +}
- Changed
send_message3 fields changed- removed
Output schema / additionalPropertiesRemoved value: -true - added
Output schema / descriptionAdded value: +"Return type for ``send_message`` and ``edit_message``." - added
Output schema / propertiesAdded value: +{ + "action": { + "type": "string" + }, + "chat": { + "additionalProperties": true, + "type": "object" + }, + "code": { + "type": "integer" + }, + "date": { + "type": "string" + }, + "edit_date": { + "type": "string" + }, + "error": { + "type": "string" + }, + "error_code": { + "type": "string" + }, + "exception": { + "additionalProperties": true, + "type": "object" + }, + "message_id": { + "type": "integer" + }, + "ok": { + "type": "boolean" + }, + "operation": { + "type": "string" + }, + "params": { + "additionalProperties": true, + "type": "object" + }, + "reply_markup": { + "additionalProperties": true, + "type": "object" + }, + "sender": { + "additionalProperties": true, + "type": "object" + }, + "status": { + "type": "string" + }, + "text": { + "type": "string" + }, + "topic_id": { + "type": "integer" + } +}
- Changed
send_message_to_phone3 fields changed- removed
Output schema / additionalPropertiesRemoved value: -true - added
Output schema / descriptionAdded value: +"Return type for ``send_message_to_phone``." - added
Output schema / propertiesAdded value: +{ + "action": { + "type": "string" + }, + "chat": { + "additionalProperties": true, + "type": "object" + }, + "code": { + "type": "integer" + }, + "contact_removed": { + "type": "boolean" + }, + "contact_was_new": { + "type": "boolean" + }, + "date": { + "type": "string" + }, + "edit_date": { + "type": "string" + }, + "error": { + "type": "string" + }, + "error_code": { + "type": "string" + }, + "exception": { + "additionalProperties": true, + "type": "object" + }, + "message_id": { + "type": "integer" + }, + "ok": { + "type": "boolean" + }, + "operation": { + "type": "string" + }, + "params": { + "additionalProperties": true, + "type": "object" + }, + "phone_number": { + "type": "string" + }, + "reply_markup": { + "additionalProperties": true, + "type": "object" + }, + "sender": { + "additionalProperties": true, + "type": "object" + }, + "status": { + "type": "string" + }, + "text": { + "type": "string" + }, + "topic_id": { + "type": "integer" + } +}
2 tool updates
v0.29.0- Changed
send_message1 field changed- changed
Input schema / properties / files / descriptionPrevious value: -"List of attachment URLs or local paths (one or more strings). Local paths work in stdio mode only."New value: +"List of attachment URLs, local paths, or data URIs (one or more strings). data: URIs (data:<mime>;base64,<payload>) work in all server modes; local paths work in stdio mode only."
- Changed
send_message_to_phone1 field changed- changed
Input schema / properties / files / descriptionPrevious value: -"List of attachment URLs or local paths (one or more strings). Local paths work in stdio mode only."New value: +"List of attachment URLs, local paths, or data URIs (one or more strings). data: URIs (data:<mime>;base64,<payload>) work in all server modes; local paths work in stdio mode only."
8 tool updates
v0.21.0- First observed
edit_message - First observed
find_chats - First observed
get_chat_info - First observed
get_messages - First observed
invoke_mtproto - First observed
search_messages_globally - First observed
send_message - First observed
send_message_to_phone
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: editing messages, sending to chats or phone numbers, searching globally or per chat, retrieving chat info, and low-level API access. No ambiguity between tools.
All tool names follow a consistent verb_noun snake_case pattern (e.g., edit_message, find_chats, get_chat_info). No mixing of styles or vague verbs.
8 tools is well-scoped for a Telegram MCP server, covering essential messaging, search, and low-level operations without being excessive or insufficient.
Core messaging workflows (send, edit, search, find) are covered. Missing a delete_message tool, but invoke_mtproto can fill gaps. Minor gap for a common operation.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
Unified messaging MCP server: WhatsApp, Instagram, Telegram, SMS, Messenger & email support inbox
1MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
FastMCP server for posting formatted content to X (Twitter) — Tollbooth-monetized, DPYC-native
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProduction-grade MCP server for Telegram with dual-mode Bot API and MTProto. 6 composite tools covering messages, chats, media, contacts management with 3-tier token optimization.11Apache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP server that connects AI assistants to your real Telegram account via User API (MTProto). Features default-deny ACL with per-chat permissions, message search, file sending, forwarding, media downloads, and rate limiting.3MIT
- AlicenseNot gradedqualityBmaintenanceTelegram MTProto-based MCP server with 19 tools for reading, searching, sending, forwarding, and summarizing messagesMIT
- AlicenseNot gradedqualityCmaintenancePrivacy-first Telegram MCP server enabling maintainers to triage chats, inspect context, search messages, draft replies, and send authorized messages locally without a cloud relay.301MIT