Skip to main content
Glama
prem-research

Telegram MCP Server

telegram-mcp

Requirements

Related MCP server: io.github.daedalus/mcp-telegram-bot

Usage

  1. install dependencies

pip3 install uv
uv venv
source .venv/bin/activate
uv sync
  1. edit .env file with your telegram api id and hash (My Telegram), don't share with others.

  2. start the http-server

uv run http-server/http-server.py

  1. install the MCP Server

uv run mcp install mcp-server/mcp-server.py

Available Functions

The MCP Server provides the following functions:

  • get_unread_entities: Get entities which have unread messages in them

  • get_unread_messages(id): Get all unread messages from a given entity id

  • get_messages(id, count): Get messages limited by a count from an entity

  • get_entities: Get all entities in the current session

  • get_entity_by_id(id): Get an entity from the current session

  • send_message(entity_id, content, reply_to_message_id): Send a message to an entity with optional markup and reply

Common Issues & How to Fix

  • Claude can't run MCP server >> Install uv with brew : brew install uv

  • Can't create new app in Telegram >> Disconnect VPN and retry

License

MIT

Available Tools

6 tools
get_entitiesB

Get all entities in the current session

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves entities but lacks details on permissions required, rate limits, pagination, return format, or error handling. For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It front-loads the key information ('Get all entities') and adds necessary context ('in the current session') efficiently. Every part of the sentence contributes directly to understanding the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema), the description is minimal but adequate for basic understanding. However, with no annotations and no output schema, it fails to address behavioral aspects like return format, session dependencies, or error cases. For a tool that likely returns a list of entities, more context on what 'entities' entail would be helpful, making it incomplete for full agent usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, and it appropriately doesn't mention any. A baseline of 4 is applied for zero parameters, as there's nothing to compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('entities'), and specifies scope ('in the current session'). It distinguishes from siblings like 'get_entity_by_id' (specific entity) and 'get_unread_entities' (filtered by status). However, it doesn't explicitly differentiate from 'get_messages' or 'get_unread_messages', which might be related entity types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active session), exclusions, or comparisons to siblings like 'get_unread_entities' for filtered results or 'get_entity_by_id' for a single entity. Usage is implied by the scope 'current session' but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_entity_by_idC

Get an entity from the current session

ParametersJSON Schema
NameRequiredDescriptionDefault
idNo

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a 'Get' operation but doesn't clarify if this is a read-only operation, what permissions are required, whether it's cached or real-time, what happens if the entity doesn't exist, or what format the response takes. The description provides minimal behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point. It's appropriately sized for a simple retrieval tool, though it could potentially benefit from slightly more detail given the lack of annotations and schema documentation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, 0% schema description coverage, and no output schema, the description is insufficient. It doesn't explain what constitutes an 'entity', what data is returned, error conditions, or how this differs from sibling tools. The description leaves too many open questions for effective tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage for its single 'id' parameter, and the tool description provides no information about what the 'id' parameter represents, its format, or where to obtain valid IDs. The description doesn't compensate for the complete lack of parameter documentation in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Get') and resource ('entity'), but lacks specificity about what an 'entity' represents in this context. It mentions 'from the current session' which provides some scope, but doesn't distinguish this tool from sibling tools like 'get_entities' or 'get_unread_entities' that likely retrieve similar data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like 'get_entities' or 'get_unread_entities'. The phrase 'from the current session' implies some contextual limitation, but doesn't provide clear when/when-not criteria or mention sibling tools as alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_messagesC

Get messages limited by a count from an entity

ParametersJSON Schema
NameRequiredDescriptionDefault
idYes
countNo

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'limited by a count' but doesn't explain what happens if count is 0 (default), whether this is a read-only operation, how results are returned, or any rate limits or permissions required. The description adds minimal behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's appropriately sized for a simple tool, though it could be more front-loaded with key details. The structure is clear but minimal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (2 parameters, no output schema, no annotations), the description is incomplete. It lacks details on return values, error handling, behavioral traits, and parameter specifics. For a tool with zero schema coverage and no annotations, this description leaves significant gaps in understanding how to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'limited by a count' and 'from an entity', which loosely maps to the 'count' and 'id' parameters, but doesn't clarify what 'entity' means (e.g., user, channel, group) or provide format details. The description adds some meaning but insufficiently compensates for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Get messages limited by a count from an entity', which provides a basic verb+resource combination ('get messages'). However, it's vague about what 'entity' refers to and doesn't distinguish this tool from sibling tools like 'get_unread_messages'. The purpose is understandable but lacks specificity and differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_unread_messages' or 'get_entities', nor does it specify prerequisites, exclusions, or appropriate contexts. Usage is implied but not explicitly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_unread_entitiesC

get entitites which have unread messages in it

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'get entities which have unread messages in it', implying a read-only operation that filters entities based on unread status. However, it doesn't describe the return format (e.g., list of entities, pagination), error conditions, or any side effects. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence: 'get entities which have unread messages in it'. It's concise but under-specified, lacking necessary details like entity type or behavioral context. While it's front-loaded with the core purpose, it fails to earn its place by not adding enough value beyond the tool name, making it more of a tautology than a helpful description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a filtering operation with no parameters) and the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'entities' are, what 'unread messages' means, or what the return value looks like. For a tool that likely returns a list of entities, more context is needed to guide an AI agent effectively, especially with sibling tools that might overlap in functionality.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to add parameter semantics beyond what the schema provides. A baseline score of 4 is appropriate as the description doesn't contradict the schema and the lack of parameters is clear from the context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'get entities which have unread messages in it' restates the tool name 'get_unread_entities' in slightly different words, making it a tautology. It doesn't specify what type of entities (e.g., users, channels, conversations) or what 'unread messages' means in this context. While it implies a read operation, it lacks the specificity needed to distinguish it from sibling tools like 'get_entities' or 'get_unread_messages'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, such as authentication or context needed, or compare it to sibling tools like 'get_unread_messages' (which might return messages directly) or 'get_entities' (which might return all entities regardless of read status). The description implies a filtering condition ('unread messages'), but doesn't clarify the use case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_unread_messagesC

get all unread messages from a given entity id

ParametersJSON Schema
NameRequiredDescriptionDefault
idNo

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool retrieves unread messages but doesn't describe what 'unread' means in this context, whether there are pagination limits, authentication requirements, rate limits, or what format the messages are returned in. For a read operation with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized for a simple retrieval tool and front-loads the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 1 parameter, 0% schema description coverage, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the return format, error conditions, what 'unread' means operationally, or how this differs from similar sibling tools. The context demands more explanation than provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions 'from a given entity id' which maps to the 'id' parameter, but doesn't explain what an 'entity' represents in this system, whether the ID refers to a user, group, or other entity type, or what happens if no ID is provided (since required parameters is 0). This adds minimal semantic value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('get all unread messages') and target resource ('from a given entity id'), providing a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from sibling tools like 'get_messages' or 'get_unread_entities', which would require more differentiation to earn a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_messages' or 'get_unread_entities'. It mentions the parameter ('from a given entity id') but doesn't explain when this specific unread-message retrieval is appropriate versus other message-related tools in the sibling list.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

send_messageC

Send a message to an entity with optional markup and reply

ParametersJSON Schema
NameRequiredDescriptionDefault
entity_idYes
contentNo
reply_to_message_idNo

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'optional markup and reply,' hinting at features, but fails to disclose critical traits like required permissions, rate limits, error handling, or whether the operation is idempotent. This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Send a message to an entity') and adds brief detail ('with optional markup and reply'). It avoids redundancy and waste, making it appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's mutation nature, 3 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks details on behavior, parameter usage, error cases, and return values, making it insufficient for safe and effective agent invocation in this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It adds minimal semantics by noting 'optional markup and reply,' which loosely relates to 'content' and 'reply_to_message_id,' but does not explain parameter meanings, formats, or constraints beyond what the schema titles imply, failing to adequately cover the 3 parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear verb ('Send') and resource ('a message to an entity'), specifying the action and target. It distinguishes from sibling tools like 'get_messages' by focusing on sending rather than retrieving, but does not explicitly differentiate from potential other send-related tools (none listed), keeping it at a 4.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as when to send a message vs. retrieve messages or handle entities. It lacks context about prerequisites, timing, or exclusions, offering only basic functional intent without usage scenarios.

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. 6 tool updates
    • First observedget_entities
    • First observedget_entity_by_id
    • First observedget_messages
    • First observedget_unread_entities
    • First observedget_unread_messages
    • First observedsend_message

TDQS

B3.1/5.0

Scored across 6 tools

Disambiguation4/5

Most tools have distinct purposes, but there is some overlap between get_entities and get_unread_entities, as both retrieve entities, which could cause confusion about which to use. However, the descriptions clarify that one gets all entities and the other gets only those with unread messages, mitigating ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case, such as get_entities, send_message, and get_unread_messages. There are no deviations in naming conventions, making the set predictable and easy to understand.

Tool Count5/5

With 6 tools, this server is well-scoped for managing Telegram sessions, covering key operations like retrieving entities, messages, and sending messages. The count is appropriate, avoiding bloat while providing essential functionality.

Completeness4/5

The toolset covers core messaging workflows, including reading and sending messages, but lacks operations for updating or deleting messages, which might be expected in a messaging domain. However, the provided tools handle the primary use cases effectively.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that enables interaction with Telegram to send, read, and search messages across chats and dialogs. It supports waiting for incoming messages and retrieving conversation history through natural language commands.
    22
    4
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    MCP server that exposes a Telegram bot, enabling sending messages and retrieving updates through natural language.
    3
    1
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    An MCP server for interacting with Telegram bots and channels using the Telegraf library. It allows AI agents to send messages, manage channels, forward content, and intelligently respond to Telegram conversations.
    5
    27
    8
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for sending and receiving Telegram messages via a bot, enabling AI assistants to interact directly through Telegram by sending messages, reading recent messages, and sending photos.
    10
    MIT