Skip to main content
Glama
DLHellMe
by DLHellMe

telegram_login

Authenticate with Telegram Web to access restricted content, enabling interaction with channels and groups through API access and web scraping.

Instructions

Authenticate with Telegram Web to access restricted content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
phone_numberNoPhone number in international format (optional, for automated login)

Implementation Reference

  • The main handler function for the 'telegram_login' tool. It extracts the phone number from arguments, calls this.auth.login(), and returns success or error messages in MCP content format.
      private async handleTelegramLogin(args: any): Promise<any> {
        const phoneNumber = args.phone_number;
        
        try {
          const success = await this.auth.login(phoneNumber);
          
          if (success) {
            return {
              content: [
                {
                  type: 'text',
                  text: `✅ Successfully authenticated with Telegram!
    
    You can now use the authenticated scraping tools to access restricted content.
    
    Use 'scrape_channel_authenticated' to scrape channels with full access.`
                }
              ]
            };
          } else {
            return {
              content: [
                {
                  type: 'text',
                  text: `❌ Authentication failed. Please try again.
    
    Make sure to:
    1. Complete the login process in the browser window
    2. Enter the verification code if prompted
    3. Allow sufficient time for the login to complete`
                }
              ]
            };
          }
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `❌ Login error: ${error instanceof Error ? error.message : 'Unknown error'}
    
    Please check:
    - Chrome is installed and accessible
    - You have a stable internet connection
    - The phone number is in international format (if provided)`
              }
            ]
          };
        }
      }
  • src/server.ts:221-234 (registration)
    The tool registration entry in the getTools() method, which lists 'telegram_login' for the ListToolsRequestSchema, including its description and input schema.
    {
      name: 'telegram_login',
      description: 'Authenticate with Telegram Web to access restricted content',
      inputSchema: {
        type: 'object',
        properties: {
          phone_number: {
            type: 'string',
            description: 'Phone number in international format (optional, for automated login)'
          }
        },
        required: []
      }
    },
  • Dispatch case in the main tool call handler switch statement that routes 'telegram_login' calls to the handleTelegramLogin method.
    case 'telegram_login':
      return await this.handleTelegramLogin(args);
  • Input schema definition for the 'telegram_login' tool, specifying optional phone_number parameter.
    inputSchema: {
      type: 'object',
      properties: {
        phone_number: {
          type: 'string',
          description: 'Phone number in international format (optional, for automated login)'
        }
      },
      required: []
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 authenticates to access restricted content, implying a write/mutation operation that may require user credentials or permissions, but it doesn't detail what authentication entails (e.g., OTP, password), potential side effects (e.g., session creation), rate limits, or error handling. This is a significant gap for an authentication tool with zero annotation coverage.

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 front-loads the core purpose ('Authenticate with Telegram Web') and adds the outcome ('to access restricted content'). There is no wasted verbiage or redundancy, making it highly concise and well-structured for quick understanding.

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 of an authentication tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., what happens on success/failure, session management), usage context relative to siblings, and return values. While concise, it fails to provide sufficient context for safe and effective tool invocation by an agent.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'phone_number' documented as optional and in international format. The description adds no additional parameter semantics beyond what the schema provides, such as explaining when to provide the phone number or how it affects authentication. Given the high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 ('Authenticate') and target ('Telegram Web'), with the purpose being to 'access restricted content'. It distinguishes from siblings like 'telegram_auth_status' (check status) and 'telegram_logout' (end session), though it doesn't explicitly name alternatives. However, it doesn't fully differentiate from 'telegram_api_login', which might serve a similar authentication purpose.

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 'telegram_api_login' or 'telegram_auth_status'. It mentions accessing restricted content, but doesn't specify prerequisites (e.g., whether prior login is needed) or exclusions (e.g., when not to use it if already authenticated). This leaves the agent with minimal context for decision-making.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DLHellMe/telegram-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server