Skip to main content
Glama
telegram-archive-mcp

telegram-archive-mcp

by GeiserX

Read one day of a chat

get_messages_by_date
Read-onlyIdempotent

Retrieve all messages from a Telegram chat for a given calendar day, ordered oldest first and timezone-aware, to answer what was said on that day.

Instructions

Get every message of a Telegram chat sent on one calendar day, oldest first. The day is taken in the given timezone (default UTC); the archive stores dates in UTC. Walks the chat with the keyset cursor, so it is cheap even on chats with hundreds of thousands of messages. Use it to answer "what was said on "; use get_messages to page through a chat instead.

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": {
      "chat_id": "<chat_id>",
      "date": "<date>"
    },
    "name": "get_messages_by_date"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateYesThe calendar day, YYYY-MM-DD (e.g. 2026-06-10).
limitNoMaximum messages to return, 1 to 5000 (default 1000). When the day has more, the newest are dropped and truncated is true.
chat_idYesThe chat's ref, as list_chats or search_all_chats returns it (an opaque string; not the numeric Telegram id).
timezoneNoIANA timezone the date is expressed in (e.g. Europe/Madrid). Default UTC.
topic_idNoForum topic id from get_topics; keeps only that topic's messages. 1 is the General topic. Omit for the whole chat.

Output Schema

NameRequiredDescriptionDefault
dateYesThe day asked for, YYYY-MM-DD.
countYesMessages returned.
messagesYesThe day's messages, oldest first, with the same fields as get_messages.
timezoneYesIANA timezone the day was taken in.
topic_idNoThe forum topic filter, when one was given.
truncatedYesTrue when the day held more than limit messages and the newest were dropped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv0.4.1
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / chat_id / description
      Previous value: -"Chat ID to retrieve messages from"New value: +"The chat's ref, as list_chats or search_all_chats returns it (an opaque string; not the numeric Telegram id)."
    • addedInput schema / properties / chat_id / minLength
      Added value: +1
    • changedInput schema / properties / date / description
      Previous value: -"Date in YYYY-MM-DD format"New value: +"The calendar day, YYYY-MM-DD (e.g. 2026-06-10)."
    • addedInput schema / properties / date / pattern
      Added value: +"^\\d{4}-\\d{2}-\\d{2}$"
    • addedInput schema / properties / limit / default
      Added value: +1000
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum messages to return (default 1000, max 5000). When the day has more, the newest are dropped and truncated is true."New value: +"Maximum messages to return, 1 to 5000 (default 1000). When the day has more, the newest are dropped and truncated is true."
    • addedInput schema / properties / limit / maximum
      Added value: +5000
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedInput schema / properties / limit / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / topic_id
      Added value: +{
      +  "description": "Forum topic id from get_topics; keeps only that topic's messages. 1 is the General topic. Omit for the whole chat.",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "count": {
      +      "description": "Messages returned.",
      +      "type": "integer"
      +    },
      +    "date": {
      +      "description": "The day asked for, YYYY-MM-DD.",
      +      "type": "string"
      +    },
      +    "messages": {
      +      "description": "The day's messages, oldest first, with the same fields as get_messages.",
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "timezone": {
      +      "description": "IANA timezone the day was taken in.",
      +      "type": "string"
      +    },
      +    "topic_id": {
      +      "description": "The forum topic filter, when one was given.",
      +      "type": "integer"
      +    },
      +    "truncated": {
      +      "description": "True when the day held more than limit messages and the newest were dropped.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "date",
      +    "timezone",
      +    "count",
      +    "truncated",
      +    "messages"
      +  ],
      +  "type": "object"
      +}
  2. Changed2 schema fields changedv0.1.3
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Maximum messages to return (default 1000, max 5000). When the day has more, the newest are dropped and truncated is true.",
      +  "type": "number"
      +}
    • changedInput schema / properties / timezone / description
      Previous value: -"IANA timezone (e.g. Europe/Madrid). Optional."New value: +"IANA timezone the date is expressed in (e.g. Europe/Madrid). Default UTC."
  3. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive, closed-world behavior. Beyond that the description adds real context: oldest-first ordering, day resolution via timezone with UTC archive storage, and a keyset-cursor cost profile that is cheap on huge chats. It doesn't discuss the truncation/limit boundary, but that is handled in the parameter schema.

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 sentences, each earning its place: what it returns, how the time window is resolved and why it is fast, then when to pick it over the alternative. Ordering and scope are front-loaded.

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

Completeness5/5

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

With a rich schema, an output schema, and full annotations, this description supplies exactly the missing pieces — ordering, timezone semantics, performance, and sibling routing. Nothing needed to invoke it correctly is absent.

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 coverage is 100%, so baseline is 3. The description still adds meaning beyond it by explaining how the day boundary is computed (caller timezone vs. UTC-stored archive), which is the least obvious semantic of the date/timezone pair and not spelled out in either field.

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?

States a specific verb and resource with narrow scope: every message of one chat on one calendar day, oldest first. It also explicitly contrasts with get_messages, so an agent can distinguish it from siblings without opening a 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?

Gives both the positive case (answer "what was said on <day>") and the negative routing rule (use get_messages to page through a chat). That is an explicit when-to-use and when-to-use-something-else, not an inference.

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