Skip to main content
Glama
tgsearch-mcp

tgsearch-mcp

by schebotar

tg_get_messages

Read Telegram chat history and fetch specific messages by IDs, around search hits, pagination cursors, or dates to retrieve the needed conversation context.

Instructions

Read history or fetch specific messages.

Use ids for exact messages, around_id for context around a search hit, before_id/after_id for pagination, and no cursor for the latest messages. Results are oldest first and include next cursors.

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
idsNoFetch these exact message ids.
chatYesChat reference: @username, t.me link, or numeric chat id.
limitNo
after_idNoMessages newer than this id.
max_dateNoISO date or unix timestamp; date-only means end of day.
min_dateNoISO date or unix timestamp.
topic_idNoForum topic id.
around_idNoContext around this id (limit/2 on each side).
before_idNoMessages older than this id.
max_text_charsNoMaximum characters of message text per message.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose two non-obvious behaviors: results are ordered oldest-first and include `next` cursors for paging. It does not mention that text is truncated by max_text_chars, whether history depth is limited, or any permission/auth requirements for reading a chat.

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?

Four short sentences, front-loaded with the core verb, then the parameter-mode guidance, then return semantics. Nothing is wasted and the ordering follows how an agent would reason about the call.

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 10-parameter read tool with an output schema present, the description covers the important behavioral facts (ordering, cursors, cursor-mode selection). It falls slightly short on truncation behavior from max_text_chars and on default limit behavior.

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 90%, so the baseline is 3; the description goes beyond by mapping cursor parameters to distinct retrieval intents (exact, context, pagination, latest), which tells an agent how to combine them. It adds no meaning for limit, date filters, topic_id, or max_text_chars beyond the schema text.

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 history or fetch specific messages') and distinguishes the two modes of the tool. It does not explicitly name a sibling such as tg_search_messages for text search, but the retrieval-vs-search distinction is implied by 'context around a search hit'.

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?

Gives concrete mode-selection guidance: ids for exact messages, around_id for context, before_id/after_id for pagination, no cursor for latest. It lacks an explicit when-not statement or a named alternative for text search, so it stops short of a 5.

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