Skip to main content
Glama

Read messages

tg_get_messages
Read-only

Read a Telegram chat’s message history, newest first, with paging and filters for date range, message ID, keyword, or media-only results.

Instructions

Read a chat's history (newest first by default). Page with offset_id=next_offset_id. Supports date range, id range, keyword and media-only.

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": "<chat>"
    },
    "name": "tg_get_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
chatYesChat: @username, username, t.me link, t.me/c/<id> link, or numeric id such as -100123…
limitNo
queryNoKeyword search
sinceNo
untilNo
fieldsNoKeep only these fields in list items (e.g. ["message_id","name","size"])
formatNocompact = lists as {columns, rows} tables; saves a lot of context for long listingsjson
max_idNo
min_idNo
accountNoAccount id (see tg_list_accounts). Defaults to the default account.
text_maxNoMax characters per message text
offset_idNoContinue after this id (paging cursor)
media_onlyNo
oldest_firstNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description adds real behavioral detail beyond that: default newest-first ordering, the paging cursor convention (implying a next_offset_id in the response), and available filter modes. It still says nothing about result shape, per-call limits, or rate/authorization constraints.

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?

Two dense sentences, front-loaded with the primary action and default ordering, followed by the paging mechanic and the filter menu. No filler or restatement of the title.

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 14-parameter read tool with no output schema, the description covers ordering, paging and filter dimensions well. It does not describe the returned message items or how text truncation (text_max) affects output, but the essential calling information is present.

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 only 50%, and undescribed parameters include since, until, min_id, max_id, media_only and oldest_first. The description compensates by naming the date range, id range, keyword and media-only modes and the ordering default, effectively covering the undocumented half. It adds no detail on limit, account or text_max, which the schema handles itself.

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 — 'Read a chat's history' — with a default ordering qualifier, which is more precise than the title 'Read messages'. It does not explicitly distinguish itself from siblings like tg_search_messages, which also does keyword matching, so differentiation is implied rather than stated.

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 paging instruction ('Page with offset_id=next_offset_id') is concrete operational guidance, and the enumerated filter modes hint at when the tool applies. However, there is no explicit when-to-use/when-not guidance versus tg_search_messages or tg_get_message, even though the keyword-search overlap makes that distinction genuinely ambiguous.

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