get_channel_info
Retrieve detailed information about Telegram channels using the Bot API, enabling automated management and monitoring of channel data for bot operations.
Instructions
Get information about the Telegram channel
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:461-472 (handler)The handler logic for the 'get_channel_info' tool. It uses the TelegramBot instance to call getChat(CHANNEL_ID), retrieves channel details like title, ID, type, username, description, and member count, and returns a formatted text response.case 'get_channel_info': { const chat = await bot.getChat(CHANNEL_ID); return { content: [ { type: 'text', text: `📱 Channel Information:\n\n🏷️ Title: ${chat.title}\n🆔 ID: ${chat.id}\n📝 Type: ${chat.type}\n👤 Username: ${chat.username || 'Not set'}\n📄 Description: ${chat.description || 'No description'}\n👥 Members: ${(chat as any).member_count || 'Unknown'}`, }, ], }; }
- src/index.ts:188-195 (registration)Registration of the 'get_channel_info' tool in the listTools response, including its name, description, and empty input schema (no parameters required).{ name: 'get_channel_info', description: 'Get information about the Telegram channel', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:191-195 (schema)Input schema for 'get_channel_info' tool, defined as an empty object since no input parameters are needed.inputSchema: { type: 'object', properties: {}, }, },