Skip to main content
Glama

Read a Telegram attachment

telegram_get_file
Idempotent

Use this to read a document shared in Telegram and answer questions about its contents, such as a contract, invoice or spreadsheet. First locate the message with telegram_get_messages or telegram_search_messages to obtain chat_id and message_id. This does not search for files by name. For a spreadsheet (.xlsx), Word document (.docx), PDF or any text format this returns the actual contents — cells, paragraphs, rows — so you can answer questions about what is inside it. Spreadsheet rows come back tab-separated, one sheet per '## name' heading. For a video, audio or image there is a link and metadata; Session audio/video also returns a ready transcript when available. Reusing a ready bot or Session transcript is free. For Session audio/video, transcribe=true explicitly requests a new transcript using ordinary minutes only if none exists. Pending work persists; check again later, without repeated polling. Use the chat_id and message_id of a message whose message_type is not 'text'. Telegram refuses to serve files over 20 MB to a bot, so those cannot be fetched.

Input Schema

NameRequiredDescriptionDefault
chat_idYesChat the file is in.
max_charsNoHow much text to return at once. Defaults to a readable slice.
message_idYesmessage_id of the message carrying the file.
transcribeNoDefault false. Only on an explicit user request, transcribe Session audio/video if no ready transcript exists; consumes normal minutes on success.
include_textNoDefault true. Set false to get only metadata and skip reading contents.
offset_linesNoSkip this many lines before reading. A big spreadsheet does not fit in one response, so page through it: the result says which lines you got and how many there are in total.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / transcribe
      Added value: +{
      +  "description": "Default false. Only on an explicit user request, transcribe Session audio/video if no ready transcript exists; consumes normal minutes on success.",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations mark this readOnlyHint=false, idempotent, non-destructive and open-world; the description justifies the non-read-only flag by disclosing that transcribe consumes minutes while reusing a ready transcript is free, and that pending work persists so the agent should check back rather than poll. It also states the 20 MB bot limit and the tab-separated/per-sheet return format. The only gap is it does not describe what a pending or error response actually looks like.

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 purpose, then prerequisite, then the exclusion, then return-shape detail — a sensible ordering with no filler sentences. It is on the long side (roughly ten sentences) and could compress the media/transcript sentences, but each one carries distinct operational information.

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?

With no output schema, the description carries the return-value burden and does so: cells, paragraphs and rows for documents, tab-separated rows with '## name' sheet headings, link plus metadata for media, and a paging signal for large spreadsheets. It also closes the loop on the asynchronous transcript case, so 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.

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real semantics on top: transcribe is scoped to explicit user requests and gated on no transcript existing, and offset_lines is explained as a paging mechanism because a big spreadsheet does not fit in one response. max_chars and include_text are left entirely to their schema text.

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 and resource ('read a document shared in Telegram') scoped to answering questions about its contents. It explicitly carves out what it is not ('does not search for files by name'), which separates it from telegram_search_messages and the photo siblings.

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?

Gives an explicit prerequisite chain ('First locate the message with telegram_get_messages or telegram_search_messages to obtain chat_id and message_id'), a targeting rule ('a message whose message_type is not 'text''), and a hard constraint on transcribe ('only on an explicit user request'). It also names the failure case (over 20 MB cannot be fetched) so the agent knows when to stop rather than retry.

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