Skip to main content
Glama
DLHellMe
by DLHellMe

api_get_channel_info

Retrieve detailed information about any Telegram channel by providing its URL, enabling users to access channel data through API integration.

Instructions

Get detailed information about a Telegram channel using the API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe Telegram channel URL

Implementation Reference

  • The handler function that implements the core logic of the 'api_get_channel_info' tool: checks API connection, parses channel URL, retrieves channel information using the Telegram API client, and returns formatted details.
      async handleApiGetChannelInfo(this: any, args: any): Promise<any> {
        if (!this._apiScraper || !this._apiScraper.isConnected()) {
          return {
            content: [{
              type: 'text',
              text: '❌ Not connected to Telegram API. Please use telegram_api_login first.'
            }]
          };
        }
        
        try {
          const channelUrl = args.url || args.channel;
          const channelUsername = channelUrl.match(/(?:t\.me\/|@)([^/?]+)/)?.[1];
          
          if (!channelUsername) {
            return {
              content: [{
                type: 'text',
                text: '❌ Invalid channel URL or username'
              }]
            };
          }
          
          const client = (this._apiScraper as any).client;
          const info = await client.getChannelInfo(channelUsername);
          
          return {
            content: [{
              type: 'text',
              text: `# Channel Information
    
    **Name:** ${info.title}
    **Username:** @${info.username}
    **Type:** ${info.about}
    **Members:** ${info.participantsCount?.toLocaleString() || 'N/A'}
    **ID:** ${info.id}
    
    ✅ Retrieved using Telegram API`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: `❌ Failed to get channel info: ${error instanceof Error ? error.message : 'Unknown error'}`
            }]
          };
        }
      },
  • src/server.ts:359-372 (registration)
    Registers the 'api_get_channel_info' tool with the MCP server, including its description and input schema requiring a 'url' parameter.
    {
      name: 'api_get_channel_info',
      description: 'Get detailed information about a Telegram channel using the API',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'The Telegram channel URL'
          }
        },
        required: ['url']
      }
    },
  • src/server.ts:104-105 (registration)
    Switch case in the tool call handler that dispatches 'api_get_channel_info' calls to the bound handler method.
    case 'api_get_channel_info':
      return await this.handleApiGetChannelInfo(args);
  • src/server.ts:766-766 (registration)
    Binds the handler function from apiHandlers to the server class instance for use in tool dispatching.
    private handleApiGetChannelInfo = apiHandlers.handleApiGetChannelInfo.bind(this);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'using the API' but doesn't specify if this is a read-only operation, requires authentication, has rate limits, or what 'detailed information' entails. This leaves key behavioral traits undefined for an API-based tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function. It is appropriately sized and front-loaded with the core purpose, though it could be slightly more structured by including key details like authentication needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of interacting with a Telegram API and the lack of annotations and output schema, the description is incomplete. It doesn't cover authentication requirements, error handling, or the format of returned information, which are crucial for effective tool use in this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'url' parameter clearly documented. The description adds no additional meaning beyond the schema, such as URL format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get detailed information') and resource ('about a Telegram channel'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'get_channel_info' or 'api_scrape_channel', which appear to have similar functions, so it lacks sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools related to Telegram channels (e.g., 'api_scrape_channel', 'scrape_channel', 'get_channel_info'), there is no indication of context, prerequisites, or exclusions, leaving usage ambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DLHellMe/telegram-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server