Skip to main content
Glama
draiqw
by draiqw

tg_history

Read-onlyIdempotent

Retrieve Telegram chat history chronologically, with filters for user, search text, topic, and pagination to target specific messages.

Instructions

Read messages from one chat, oldest to newest.

Args: chat: chat id, @username, t.me link, exact title, or "me" for Saved Messages. limit: number of messages. Twenty is a conversation; raise it when reading a chat properly, not to be safe. before_id: paginate to messages older than this message id. from_user: only messages from this person. search: only messages containing this text. topic: read one forum topic instead of the whole chat (id from tg_topics). saved_from: chat="me" only — read one sub-folder of Saved Messages, the one holding everything forwarded there from this person or channel. List the sub-folders with tg_dialogs(kind="saved"). brief: drop reactions, link cards and edit times. Same messages, about a quarter smaller — for triage, not for reading a chat closely.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatYes
briefNo
limitNo
topicNo
searchNo
before_idNo
from_userNo
saved_fromNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Discloses meaningful behavior beyond the safe-read annotations: ordering (oldest to newest), pagination semantics (before_id yields older messages), and the concrete output-size effect of brief ('about a quarter smaller'). Fully consistent with readOnlyHint=true, idempotentHint=true, and destructiveHint=false — no contradiction.

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?

A single framing sentence followed by a compact Args block. Every line earns its place with operational information, and the most complex parameters (saved_from, brief) get the most explanation — no filler anywhere.

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 an 8-parameter tool with a bare schema and no output schema, the description covers all invocation semantics, including tricky conditional constraints. The only gap: the return value shape/format is not described, and no output schema exists to fill that in.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates: chat's five accepted formats, saved_from's conditional 'chat="me" only' rule, topic's id source, and brief's exact output effects all add meaning far beyond the schema's bare types and defaults.

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?

Opens with a specific verb+resource+scope: 'Read messages from one chat, oldest to newest.' The ordering constraint and the single-chat scope clearly distinguishe it from siblings like tg_history_batch, tg_search, and tg_message.

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?

Provides explicit operational guidance on parameters — 'Twenty is a conversation; raise it when reading a chat properly, not to be safe' and 'brief ... for triage, not for reading a chat closely' — and cross-references tg_topics and tg_dialogs(kind='saved'). However, it never explicitly names alternatives or states when-not-to-use this tool in favor of a sibling.

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