Skip to main content
Glama
GeiserX

telegram-archive-mcp

by GeiserX

get_messages

Read-only

Retrieve messages from a Telegram chat newest first, with paging by offset or keyset cursor using before_date/before_id for older messages and after_id for newer ones.

Instructions

Get messages from a Telegram chat, newest first. Page with offset, or with the keyset cursor: pass the date and id of the last message you received as before_date and before_id to get the older ones (constant time on huge chats). after_id returns messages newer than an id. Dates are naive UTC.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum messages to return (default 50, max 500)
offsetNoPagination offset (default 0). Ignored when a cursor is given.
chat_idYesChat ID to retrieve messages from
after_idNoReturns messages with an id greater than this one (newer).
before_idNoKeyset cursor: message id. Returns messages with a smaller id; pair with before_date.
before_dateNoKeyset cursor: ISO 8601 date-time, naive values are UTC (e.g. 2026-06-10T18:04:17). Returns messages older than this instant; pair with before_id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.3
    • addedInput schema / properties / after_id
      Added value: +{
      +  "description": "Returns messages with an id greater than this one (newer).",
      +  "type": "number"
      +}
    • addedInput schema / properties / before_date
      Added value: +{
      +  "description": "Keyset cursor: ISO 8601 date-time, naive values are UTC (e.g. 2026-06-10T18:04:17). Returns messages older than this instant; pair with before_id.",
      +  "type": "string"
      +}
    • addedInput schema / properties / before_id
      Added value: +{
      +  "description": "Keyset cursor: message id. Returns messages with a smaller id; pair with before_date.",
      +  "type": "number"
      +}
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum messages to return (default 50)"New value: +"Maximum messages to return (default 50, max 500)"
    • changedInput schema / properties / offset / description
      Previous value: -"Pagination offset (default 0)"New value: +"Pagination offset (default 0). Ignored when a cursor is given."
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds genuine context beyond that: newest-first ordering, constant-time keyset pagination on large chats, and that dates are naive UTC. It does not cover edge cases like empty results or limits at the end of a chat.

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?

Three tightly packed sentences: ordering and source first, then pagination modes, then the timezone caveat. No filler, and the most important constraint is front-loaded.

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?

For a read-only listing tool with no output schema, the description covers ordering, both pagination strategies, and date semantics adequately. Minor gaps remain around result boundaries (empty page at end of chat) and whether limit applies per page, but nothing essential for a correct call is missing.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, and the description adds value above it by explaining how before_date and before_id combine as a cursor pair and noting the performance rationale. The offset-ignored-when-cursor-given rule repeats the schema, so the gain is modest.

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?

States a specific verb and resource ('Get messages from a Telegram chat') plus a defining behavioral trait ('newest first'). It does not explicitly differentiate from the sibling get_messages_by_date or search_messages, so an agent must infer the boundary from the pagination detail rather than being told.

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 explains how to paginate (offset vs. keyset cursor via before_date/before_id, or after_id for newer) but never says when to choose this tool over get_messages_by_date or search_messages. Usage of the tool itself is implied by the pagination recipe; sibling routing is absent.

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