Skip to main content
Glama

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: []

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