Skip to main content
Glama
telegram-mcp

telegram-mcp

by Maxsh

search_messages

Search messages in a Telegram channel, group, or private chat by query and date filters to locate relevant conversations.

Instructions

Search for messages in a Telegram channel, group, or private chat

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "channel": "<channel>",
      "query": "<query>"
    },
    "name": "search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
tzNoIANA time zone used to resolve date-only sinceDate and 'today'/'yesterday' (e.g., Europe/Kyiv). Default: UTC
limitNoNumber of messages to retrieve (default: 10, max: 100)
queryYesSearch query
channelYesChannel username (@channelname), group username, private chat username (@username), phone number (+1234567890), or chat ID
offsetIdNoReturn matches older than this message ID
sinceDateNoSearch messages since this date. Accepts a full ISO datetime, a plain date (midnight in tz), or 'today' / 'yesterday'
sinceHoursNoSearch messages from the last N hours
sinceMinutesNoSearch messages from the last N minutes
maxTextLengthNoTruncate each message text to this many characters

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.0
    • addedInput schema / properties / maxTextLength
      Added value: +{
      +  "description": "Truncate each message text to this many characters",
      +  "minimum": 1,
      +  "type": "number"
      +}
    • addedInput schema / properties / offsetId
      Added value: +{
      +  "description": "Return matches older than this message ID",
      +  "type": "number"
      +}
    • changedInput schema / properties / sinceDate / description
      Previous value: -"Search messages since this date (ISO format: 2023-12-01T10:00:00Z)"New value: +"Search messages since this date. Accepts a full ISO datetime, a plain date (midnight in tz), or 'today' / 'yesterday'"
    • addedInput schema / properties / tz
      Added value: +{
      +  "description": "IANA time zone used to resolve date-only sinceDate and 'today'/'yesterday' (e.g., Europe/Kyiv). Default: UTC",
      +  "type": "string"
      +}
  2. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description bears the full burden, yet it discloses nothing about auth requirements, Telegram search rate limits, result ordering, or how pagination via offsetId behaves. The one sentence restates the name rather than adding behavioral context.

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?

A single front-loaded sentence with zero filler. It is efficient, though its brevity is a consequence of under-specification rather than disciplined editing.

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?

For a nine-parameter tool with no annotations and no output schema, the description omits prerequisites, result shape, and the interaction among limit, offsetId, and the time-window filters. An agent could call it, but not confidently or efficiently.

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 all nine parameters including tz, sinceDate, sinceHours, and maxTextLength are already documented in the schema. The description adds no extra meaning such as query syntax or precedence between the overlapping time filters, so baseline 3 applies.

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 states a specific verb ('Search') and resource ('messages') and constrains the scope to Telegram channels, groups, and private chats. It does not differentiate itself from siblings like get_recent_messages, check_unread_messages, or get_messages_multi, so an agent cannot tell from the text alone which retrieval tool to pick.

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?

There is no when-to-use guidance and no named alternative. The agent is not told how this differs from listing recent messages or reading unread messages, nor are prerequisites (e.g., authorization) or query semantics mentioned.

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