Skip to main content
Glama
egor-fedorov

Telegram Context MCP

by egor-fedorov

export_history

Export a selected Telegram chat's original history to JSONL or Markdown, with optional date filters, resumable checkpoints, and an option to save a permanent archive copy.

Instructions

Export one selected chat's original history as JSONL or Markdown.

    Start with chat_ref and optional dates (lower inclusive, upper exclusive),
    then continue with checkpoint only and the desired format. Upper date and ID
    are frozen; each part has at most 1000 records/20 MiB within RPC/time budgets.
    Read the returned resource explicitly before its 15-minute expiry. Files are
    local to the server, temporary, and include source references and full text;
    attachments are metadata only. Protected/expiring records are omitted explicitly.
    complete means the range was scanned; omitted_count and issues still matter.
    A non-null next_checkpoint survives restart; an empty part can need continuation.
    On temporary errors continue the returned token after any retry delay. On tool
    errors the original token remains usable. save=true retains a permanent archive copy.
    No snapshot consistency across Telegram edits.
    

Input Schema

NameRequiredDescriptionDefault
saveNo
formatNojsonl
date_toNo
chat_refNo
date_fromNo
checkpointNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4/5.0
Behavior5/5

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

Discloses far more than the annotations: per-part limits (1000 records/20 MiB), RPC/time budgets, a 15-minute expiry on the returned resource, server-local temporary files, attachments as metadata only, omission of protected/expiring records, semantics of complete/omitted_count/issues, checkpoint survival across restarts, retry behavior on temporary vs tool errors, and absence of snapshot consistency. The readOnlyHint=false annotation is consistent with the described file-writing/archive behavior.

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?

Front-loads the action and then packs only operational facts with no filler. The telegraphic sentence fragments ('Upper date and ID are frozen', 'A non-null next_checkpoint survives restart') cost some readability but every line carries information.

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 complex paginated export with no output schema and no parameter descriptions, the description covers the mechanics an agent needs: pagination loop, resource expiry, error handling, and completeness signals. It leaves the concrete return shape (resource reference/URI) only implied by 'Read the returned resource explicitly'.

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 0%, so the description must carry the load and largely does: it defines chat_ref, lower-inclusive/upper-exclusive dates, checkpoint continuation, format, and save as a permanent archive copy. It omits chat_ref's accepted form (ID vs username vs link) and save's default, keeping it short of a 5.

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: export one selected chat's original history as JSONL or Markdown, with file-based output. That distinguishes it from in-context readers like get_history or search_messages, though it never names a sibling explicitly.

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

Usage Guidelines3/5

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

Gives a clear call sequence (start with chat_ref plus optional dates, then continue with checkpoint only) and notes save=true for a permanent archive copy. It never says when to prefer this over get_history/get_messages or what disqualifies it, so the when-to-use dimension is only implied.

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