Skip to main content
Glama
Automata MCP

Automata MCP

Read Telegram messages

read-telegram-messages
Read-onlyIdempotent

Read one page of synced Telegram chat messages newest first, filter by date range or forum topic, and page through older messages until the requested range is covered.

Instructions

[Telegram] Read one page of synced messages from one Telegram chat, newest first. Takes the chatId from list-telegram-chats, as a string. Use since/until to target a date range and topicId for one topic of a forum supergroup. A response is one page: when hasMore is true there are older messages you have not seen, so call again with nextPage and the same chatId, limit and window, and keep going until hasMore is false before treating the range as read. covered is the span this page actually covers; totalMatching counts the messages in the range. When history.complete is false, the chat has older messages that were never synced: reaching hasMore: false then means you reached the oldest synced message, not the start of the conversation, and note says why. history.gapSince means edits or deletions around that time may be missing. Telegram edits messages in place: text is the current wording, editedAt says it changed, and the earlier wording is not available. Deleted messages are left out and counted in deletedExcluded; their text is not kept. Service messages (joins, pins, title changes) are left out unless includeService is set, counted in serviceMessagesExcluded. Reactions are not kept, so a message carries no reaction data. A message you sent is marked fromMe and carries no author. To find a message by what it says, use search-telegram-messages instead of paging.

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": {
      "chatId": "<chatId>"
    },
    "name": "read-telegram-messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNo1-based page of `limit` messages, counting back from the newest. Walk this up while `hasMore` is true.
limitNoHow many messages to return in this page
sinceNoOnly messages at or after this date, e.g. 2024-03-01 or 2024-03-01T12:00:00Z
untilNoOnly messages at or before this date. Pass back `window.until` from a previous page when paging a range.
chatIdYesChat id from list-telegram-chats, as a string, e.g. "-1001234567890"
topicIdNoIn a forum supergroup, only messages in this topic
includeDeletedNoInclude deleted messages as placeholders with no text. Off by default.
includeServiceNoInclude service messages: joins, leaves, pins, title and photo changes. Off by default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, non-open-world), and the description goes well beyond them: in-place edits with no retained prior wording, deleted messages dropped and counted, reactions not stored, service messages excluded and counted, and a fromMe message carrying no author. The history.complete / gapSince caveats disclose a real limitation (unsynced older history, possible missing edits) that the agent could not otherwise know.

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?

It is long, but it is front-loaded with purpose and pagination mechanics before edge cases, and nearly every sentence carries distinct information (counts, edit semantics, exclusions, sibling routing). The only genuinely wasteful element is the nextPage/window phrasing, which adds ambiguity rather than value.

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

Completeness4/5

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

With no output schema, the description correctly takes on the return-shape burden, documenting hasMore, covered, totalMatching, deletedExcluded, serviceMessagesExcluded and the history flags. What keeps it from a 5 is that the loop instruction references response-looking names (nextPage, window) that are never reconciled with the actual page/since/until parameters.

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 coverage is 100%, so the baseline is 3, and the description does add some meaning — where chatId comes from and the intent of since/until and topicId. However, it instructs the agent to 'call again with nextPage and the same chatId, limit and window', yet the schema exposes neither nextPage nor window (the corresponding inputs are page and since/until). This naming mismatch risks an agent passing a nonexistent parameter or mis-setting the range.

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

Purpose5/5

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

The opening sentence gives a specific verb and resource ('Read one page of synced messages from one Telegram chat, newest first') and immediately scopes behavior to 'synced' data, which distinguishes it from the live-search sibling. It also names the alternative (search-telegram-messages) at the end, so an agent can route correctly without opening either schema.

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

Usage Guidelines5/5

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

Explicit guidance is given for every selection decision: since/until for date ranges, topicId for a forum topic, and a page-loop protocol ('keep going until hasMore is false') before treating the range as read. It also states the negative case — use search-telegram-messages instead of paging when looking a message up by text.

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