telegram_auth_status
Verify authentication status with Telegram to ensure secure and authorized access to channels and groups via the MCP Server.
Instructions
Check if authenticated with Telegram
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:608-621 (handler)The handler function that implements the core logic of the 'telegram_auth_status' tool. It checks the authentication status using the TelegramAuth instance and returns a standardized MCP response with markdown text indicating the status.private async handleAuthStatus(): Promise<any> { const isAuthenticated = await this.auth.isAuthenticated(); return { content: [ { type: 'text', text: isAuthenticated ? '✅ Authenticated with Telegram. You can access restricted content.' : '❌ Not authenticated. Use telegram_login to authenticate.' } ] }; }
- src/server.ts:244-252 (registration)The tool registration entry in getTools() method, which defines the tool's name, description, and input schema for the MCP server's listTools handler.{ name: 'telegram_auth_status', description: 'Check if authenticated with Telegram', inputSchema: { type: 'object', properties: {}, required: [] } },
- src/server.ts:246-251 (schema)The input schema definition for the tool, specifying no required parameters.description: 'Check if authenticated with Telegram', inputSchema: { type: 'object', properties: {}, required: [] }
- src/auth/telegram-auth.ts:307-318 (helper)Supporting helper method in TelegramAuth class that determines authentication status by checking for saved cookies via CookieManager.async isAuthenticated(): Promise<boolean> { // For Telegram Web K, we just check if auth data exists // The actual verification happens when we try to use it const hasCookies = await this.cookieManager.hasCookies(); if (hasCookies) { logger.debug('Authentication data found'); return true; } return false; }