Skip to main content
Glama

List Telegram Messages

tg_list_messages
Read-only

Read messages across your Telegram accounts, oldest first. Page with after_cursor: pass back the next_cursor you were given to see only what has arrived since. Use this to catch up after being notified of a new message. Narrow with account_id, chat, and since/until (until is exclusive). When a poll finds nothing new, wait about 30 seconds before the next one. For WhatsApp numbers use wa_list_messages.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "tg_list_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
chatNoonly this conversation — the chat's Telegram id (<id>@telegram; a group -<id>@telegram, a channel or supergroup -100<id>@telegram)
limitNohow many to return, 1-200; defaults to 50
sinceNoonly messages sent at or after this time: RFC3339 with a zone, or a date (2026-10-01 = midnight UTC); omit for no lower bound
untilNoonly messages sent BEFORE this time — exclusive; same formats as since; omit for no upper bound
account_idNoonly this Telegram account's messages, from wa_list_accounts; omit for every Telegram account
after_cursorNoreturn messages after this cursor; omit or 0 to start from the beginning
include_historyNoalso return imported history; off by default. With it on, a page is in storage order rather than time order — sort by at
include_media_urlsNoalso return attachment.media_url on each available attachment — a time-limited (1h) signed URL to GET the bytes with plain HTTP instead of a tg_get_media call; off by default

Output Schema

NameRequiredDescriptionDefault
hintNopresent when the read found nothing new: wait before polling again
refusalNopresent only when the request was declined; next_cursor is then your after_cursor, unchanged
has_moreYestrue when the page was full and more may be waiting
messagesYesmessages in order, oldest first
next_cursorYespass this as after_cursor next time to get only newer messages
account_noticesNopresent when a number this read covers is not working: new messages are not arriving on it; says why and what to do

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and idempotentHint=false, so the description carries real weight here: it discloses oldest-first ordering, that paging should feed back the returned next_cursor to see only newly arrived messages, that until is exclusive, and that no-new-data polls should be spaced ~30s. That is genuine behavioral context beyond the annotations. It stops short of describing rate limits or what an empty page looks like, keeping it short of a 5.

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?

Front-loaded with the action and ordering, then paging, then use case, then filters, then polling etiquette, then the sibling hand-off. Every sentence supplies distinct information with no restatement of the tool name or filler.

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?

An output schema exists, so return values need not be explained, and the description covers what remains: ordering, cursor paging, filter interactions, polling behavior, and cross-channel routing. For an 8-parameter read tool this is sufficient to call correctly on the first try.

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 the schema by explaining the paging contract for after_cursor ('pass back the next_cursor you were given to see only what has arrived since'), which the schema only describes as 'return messages after this cursor'. It also reinforces the exclusive nature of until and names the narrowing parameters as a set.

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 ('Read messages across your Telegram accounts') plus the default ordering ('oldest first'), and names the sibling it is not ('For WhatsApp numbers use wa_list_messages'). An agent can separate this from wa_list_messages and the tg_get_* readers 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 explicit when-to-use ('catch up after being notified of a new message'), an explicit alternative with its condition (WhatsApp → wa_list_messages), and an operational cadence for empty polls ('wait about 30 seconds'). Nothing about tool selection is left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources