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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
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: {}, }, },