Skip to main content
Glama

Get Telegram Chat

tg_get_chat
Read-only

Read the most recent messages for one Telegram account, oldest first — or, with chat, one conversation. Use this for context before replying; use tg_list_messages to page through everything new. Narrow with since/until (until is exclusive). For a WhatsApp number use wa_get_chat.

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_get_chat"
  }
}

Input Schema

NameRequiredDescriptionDefault
chatNoread ONE conversation — the chat's Telegram id (<id>@telegram); omit for the account's most recent messages across all chats
limitNohow many recent messages, 1-200; defaults to 50
sinceNoonly messages sent at or after this time: RFC3339 with a zone, or a date; omit for no lower bound
untilNoonly messages sent BEFORE this time — exclusive; same formats as since; omit for no upper bound
account_idNothe Telegram account whose conversation to read, from wa_list_accounts; omit it when the workspace has only one Telegram account
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
accountNothe account this conversation was read from
refusalNopresent only when the request was declined
has_moreNotrue when older messages match than were returned; page them with wa_list_messages(account_id, chat, since, until, include_history=true)
messagesYesrecent messages for this account, oldest first
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.4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true and idempotentHint=false; the description adds ordering ('oldest first'), the exclusive upper bound on 'until', and the purpose-built framing of reading context before replying. It does not discuss pagination or result volume, though the presence of an output schema reduces that burden. No conflict with the annotations.

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?

Two front-loaded sentences with no filler; the mode split comes first and the routing alternatives follow. The parenthetical '(until is exclusive)' mildly duplicates the schema, keeping it just below top marks.

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?

All six parameters are documented in the schema, an output schema covers return values, and the description supplies ordering, time-window semantics, and sibling routing. Nothing an agent needs to call this correctly is missing.

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 description coverage is 100%, so the parameters are already fully documented. The description restates 'since/until' narrowing and the exclusive 'until' semantics, which the schema already carries, and adds little new meaning. Baseline 3 is appropriate when the schema does the heavy lifting.

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 recent messages) and splits the two modes precisely: whole-account feed vs. one conversation when 'chat' is supplied. It also names the sibling it is not (tg_list_messages) and the cross-platform equivalent (wa_get_chat), so an agent can distinguish it 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?

Explicit when-to-use ('context before replying') and when-not ('use tg_list_messages to page through everything new'), plus a platform-routing rule ('For a WhatsApp number use wa_get_chat'). The alternative and the condition that selects it are both stated.

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