Skip to main content
Glama

Get messages in chat

get_messages
Read-onlyIdempotent

Retrieve messages from a Telegram chat: browse latest, search by text, fetch by message IDs, or load replies to a message.

Instructions

Read or search messages in one chat: browse latest, search text, fetch by ids, or load replies to a message (comments, forum topics, threads). Do not combine message_ids with query or reply_to_id. Success: messages, has_more, optional total_count and discussion fields. Full documentation: https://github.com/leshchenko1979/fast-mcp-telegram/blob/main/docs/Tools-Reference.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idYesTarget chat: numeric id (e.g. -100…), username without @, or 'me' for Saved Messages.
queryNoSearch within this chat only; comma-separated terms. Omit to browse latest or use message_ids / reply_to_id modes.
message_idsNoExact message ids to fetch. Mutually exclusive with query and reply_to_id.
reply_to_idNoAnchor message id: channel post id, forum topic_id from get_chat_info, or a message id for direct replies. Use with thread_scope.
thread_scopeNoOnly with reply_to_id. auto: full forum topic (topic_id) or channel comment thread via getReplies; else direct replies. full: nested branch under a message id (forum in-topic uses search window, not whole topic); supergroup threads use search top_msg_id. direct: immediate replies only.auto
limitNoMaximum messages to return (recommended 50 or less).
min_dateNoInclusive minimum date filter (ISO 8601 date or datetime). Omit for no lower bound.
max_dateNoInclusive maximum date filter (ISO 8601 date or datetime). Omit for no upper bound.
auto_expand_batchesNoExtra search batches to run when filters narrow results. Higher values may return more matches at the cost of latency.
include_total_countNoIf true, response may include total_count where supported (per-chat search; ignored for global search).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNo
errorNo
operationNo
codeNo
paramsNo
exceptionNo
actionNo
error_codeNo
messagesNo
has_moreNo
total_countNo
_warningNo
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the description's extra constraints (mutual exclusivity, output fields) add useful but not critical context. No contradictions.

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?

Three sentences front-loading purpose and modes, with a link to full docs. Efficient but could be slightly more streamlined.

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?

Covers all modes, constraints, and output expectations. Has output schema and documentation link. For a tool with 10 parameters and multiple modes, it provides sufficient guidance.

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 each parameter is already documented. The description adds value by explaining usage modes and mutual exclusivity, going beyond raw schema descriptions.

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?

Description clearly states it reads or searches messages in a chat, listing specific modes (browse latest, search text, fetch by ids, load replies). Distinguishes from sibling 'search_messages_globally' by focusing on a single chat.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states not to combine message_ids with query or reply_to_id, and mentions successful output fields. Provides a documentation link for more details. Could be more direct about when to use siblings, but context is clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/leshchenko1979/fast-mcp-telegram'

If you have feedback or need assistance with the MCP directory API, please join our Discord server