get_channel_info
Retrieve detailed Telegram channel or group information directly from the URL without extracting posts. Utilizes authenticated sessions for enhanced access through the Telegram MCP Server.
Instructions
Get only the channel/group information without scraping posts. Uses authenticated session if logged in.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The Telegram channel/group URL |
Implementation Reference
- src/server.ts:422-451 (handler)The handler function that implements the core logic of the 'get_channel_info' tool. It selects the appropriate scraper (authenticated or unauthenticated), scrapes only channel metadata (no posts), and formats the information as markdown.private async handleGetChannelInfo(args: any): Promise<any> { // Check if authenticated and use authenticated scraper by default const isAuthenticated = await this.auth.isAuthenticated(); const scraperToUse = isAuthenticated ? this.authScraper : this.scraper; const options: ScrapeOptions = { url: args.url, maxPosts: 0 // Don't scrape posts }; const result = await scraperToUse.scrape(options); const info = `# Channel Information **Name:** ${result.channel.name}${result.channel.verified ? ' ✓' : ''} **Username:** @${result.channel.username} ${result.channel.description ? `**Description:** ${result.channel.description}` : ''} ${result.channel.subscriberCount ? `**Subscribers:** ${result.channel.subscriberCount.toLocaleString()}` : ''} *Scraped at: ${result.scrapedAt.toISOString()}*`; return { content: [ { type: 'text', text: info } ] }; }
- src/server.ts:188-197 (schema)Input schema for the 'get_channel_info' tool, defining the required 'url' parameter.inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'The Telegram channel/group URL' } }, required: ['url'] }
- src/server.ts:185-198 (registration)Registration of the 'get_channel_info' tool in the server's tool list, including name, description, and input schema.{ name: 'get_channel_info', description: 'Get only the channel/group information without scraping posts. Uses authenticated session if logged in.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'The Telegram channel/group URL' } }, required: ['url'] } },