get_channel_info
Retrieve Telegram channel or group metadata like title, description, and subscriber count from a URL without extracting posts. Uses authenticated access when available.
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 for the 'get_channel_info' tool. It determines if authenticated scraping is available, scrapes the channel metadata (no posts), and formats the channel name, username, description, subscriber count, and scrape time into 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:185-198 (registration)Registers the 'get_channel_info' tool with the MCP server, including its description and input schema requiring a 'url' parameter.{ 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'] } },
- src/server.ts:188-197 (schema)Input schema for the 'get_channel_info' tool, defining an object with a required 'url' string property.inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'The Telegram channel/group URL' } }, required: ['url'] }