Skip to main content
Glama
DLHellMe
by DLHellMe

scrape_channel_authenticated

Extract posts from Telegram channels using authenticated access to retrieve restricted content. Specify channel URL and post limit.

Instructions

Scrape a Telegram channel using authenticated session (can access restricted content)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe Telegram channel URL (e.g., https://t.me/channelname)
max_postsNoMaximum number of posts to scrape (default: 100)

Implementation Reference

  • Core handler function for the 'scrape_channel_authenticated' tool. Verifies user authentication, configures scrape options, executes scrape using authenticated scraper instance, formats results to markdown, and returns structured response with error handling.
      private async handleScrapeChannelAuthenticated(args: any): Promise<any> {
        // Check authentication first
        const isAuthenticated = await this.auth.isAuthenticated();
        if (!isAuthenticated) {
          return {
            content: [
              {
                type: 'text',
                text: '❌ Not authenticated. Please use telegram_login first to access restricted content.'
              }
            ]
          };
        }
    
        const options: ScrapeOptions = {
          url: args.url,
          maxPosts: args.max_posts || 100,
          includeReactions: true
        };
    
        try {
          const result = await this.authScraper.scrape(options);
          const markdown = this.formatter.format(result);
    
          return {
            content: [
              {
                type: 'text',
                text: `# Authenticated Scrape Results
    
    ${markdown}
    
    ✅ Scraped using authenticated session - restricted content should be accessible.`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `❌ Authenticated scrape failed: ${error instanceof Error ? error.message : 'Unknown error'}
    
    This might happen if:
    - The authentication session expired
    - The channel requires additional permissions
    - There was a network error
    
    Try running telegram_login again if the problem persists.`
              }
            ]
          };
        }
      }
  • src/server.ts:253-271 (registration)
    Tool registration entry in getTools() method, defining name, description, and input schema for the scrape_channel_authenticated tool.
    {
      name: 'scrape_channel_authenticated',
      description: 'Scrape a Telegram channel using authenticated session (can access restricted content)',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'The Telegram channel URL (e.g., https://t.me/channelname)'
          },
          max_posts: {
            type: 'number',
            description: 'Maximum number of posts to scrape (default: 100)',
            default: 100
          }
        },
        required: ['url']
      }
    },
  • src/server.ts:89-90 (registration)
    Switch case in tool call handler that routes calls to the specific handler function.
    case 'scrape_channel_authenticated':
      return await this.handleScrapeChannelAuthenticated(args);
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It mentions authentication for accessing restricted content, which is useful, but lacks details on rate limits, pagination, error handling, or what 'scrape' entails (e.g., returns posts, metadata). For a tool with potential complexity (authentication, scraping), this is insufficient.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads key information (action, target, authentication). There is no wasted verbiage, and it directly addresses the tool's core purpose without unnecessary details.

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 tool's complexity (involving authentication and scraping), no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., posts, errors), authentication requirements, or how it differs from similar tools. More context is needed for effective use.

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?

Schema description coverage is 100%, so the schema fully documents both parameters. The description adds no additional parameter semantics beyond what's in the schema (e.g., no examples beyond the schema's URL example, no clarification on 'max_posts' behavior). Baseline 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 ('scrape') and target ('Telegram channel') with the specific condition 'using authenticated session'. It distinguishes from the sibling 'scrape_channel' by mentioning authentication, but doesn't explicitly differentiate from other authenticated scraping tools like 'scrape_channel_full' or 'scrape_group'.

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

Usage Guidelines3/5

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

The description implies when to use this tool ('can access restricted content'), suggesting it's for channels requiring authentication. However, it doesn't provide explicit guidance on when to choose this over alternatives like 'scrape_channel' (unauthenticated) or 'scrape_channel_full', nor does it mention prerequisites like needing to be logged in first.

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