Skip to main content
Glama
DLHellMe
by DLHellMe

scrape_date_range

Extract Telegram channel or group posts from a specific time period using authenticated sessions for targeted data collection.

Instructions

Scrape posts within a specific date range. Uses authenticated session if logged in.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe Telegram channel/group URL
date_fromYesStart date in ISO format (e.g., 2024-01-01)
date_toNoEnd date in ISO format (e.g., 2024-01-31)

Implementation Reference

  • The primary handler for the scrape_date_range tool. Determines if authenticated scraping is available, parses the date_from and optional date_to inputs, constructs ScrapeOptions, invokes the scraper's scrape method, formats the result using MarkdownFormatter, and returns the markdown as text content.
    private async handleScrapeDateRange(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,
        dateFrom: parseISO(args.date_from),
        dateTo: args.date_to ? parseISO(args.date_to) : new Date(),
        includeReactions: true
      };
    
      const result = await scraperToUse.scrape(options);
      const markdown = this.formatter.format(result);
    
      return {
        content: [
          {
            type: 'text',
            text: markdown
          }
        ]
      };
    }
  • src/server.ts:199-220 (registration)
    Tool registration in getTools() method, including the name, description, and JSON input schema defining parameters for URL, date_from (required), and optional date_to.
    {
      name: 'scrape_date_range',
      description: 'Scrape posts within a specific date range. Uses authenticated session if logged in.',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'The Telegram channel/group URL'
          },
          date_from: {
            type: 'string',
            description: 'Start date in ISO format (e.g., 2024-01-01)'
          },
          date_to: {
            type: 'string',
            description: 'End date in ISO format (e.g., 2024-01-31)'
          }
        },
        required: ['url', 'date_from']
      }
    },
  • Input schema for the scrape_date_range tool, specifying object with url (string, required), date_from (string ISO, required), date_to (string ISO, optional).
    inputSchema: {
      type: 'object',
      properties: {
        url: {
          type: 'string',
          description: 'The Telegram channel/group URL'
        },
        date_from: {
          type: 'string',
          description: 'Start date in ISO format (e.g., 2024-01-01)'
        },
        date_to: {
          type: 'string',
          description: 'End date in ISO format (e.g., 2024-01-31)'
        }
      },
      required: ['url', 'date_from']
    }
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 authentication dependency ('uses authenticated session if logged in'), which adds some context, but it lacks details on what 'scrape' entails (e.g., rate limits, data format, pagination, or potential side effects). For a scraping tool with no annotations, this leaves significant gaps in understanding its behavior.

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 two sentences, front-loaded with the core purpose and followed by an authentication note. Every sentence earns its place by providing essential information without redundancy or fluff. It's appropriately sized and well-structured for clarity.

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

Completeness3/5

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

Given the tool's complexity (scraping with date filtering), no annotations, and no output schema, the description is moderately complete. It covers the purpose and authentication context but lacks details on return values, error handling, or behavioral nuances. It's adequate as a minimum viable description but has clear gaps in providing a full operational picture.

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 already documents all parameters (url, date_from, date_to) with clear descriptions. The description doesn't add any meaning beyond what the schema provides, such as explaining parameter interactions or constraints. Baseline score of 3 is appropriate since 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 posts') and scope ('within a specific date range'), which is specific and actionable. It distinguishes from siblings like 'scrape_channel' or 'scrape_channel_full' by emphasizing the date-range filtering, though it doesn't explicitly name alternatives. The purpose is not vague or tautological.

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 usage context by mentioning 'uses authenticated session if logged in,' which suggests when authentication might be beneficial. However, it doesn't explicitly state when to use this tool versus alternatives like 'scrape_channel' or 'scrape_channel_authenticated,' nor does it provide exclusions or clear prerequisites. The guidance is implied rather than explicit.

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