Skip to main content
Glama

Read a Telegram attachment

telegram_get_file
Read-onlyIdempotent

Read a file someone sent. 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 no text to read and you get the filename, type, size and a link instead. 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

TableJSON 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.
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. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly/non-destructive/idempotent, yet the description adds substantial behavioral context beyond them: the exact shape of returned content (cells, paragraphs, rows), the tab-separated row format with '## name' sheet headings, what a media file returns, and the 20 MB bot-serving limit. This is exactly the kind of disclosure annotations cannot supply.

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?

Front-loaded with the core action, then branches cleanly into text formats, media formats, and the size constraint. Every sentence contributes actionable information; nothing is filler.

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: it explains text output, spreadsheet layout, pagination feedback, media metadata, and the hard 20 MB failure condition. An agent has everything needed to invoke and interpret it.

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

Parameters3/5

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

Schema description coverage is 100%, so the parameters are already documented; the description adds only the paging/format context around large files rather than per-parameter semantics. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

States a specific verb and resource ('Read a file someone sent') and immediately gives the resource scope without opening a schema. It also implicitly separates itself from sibling tools like telegram_get_photo/telegram_show_photo by noting that media yields metadata rather than text.

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 selection criteria: 'Use the chat_id and message_id of a message whose message_type is not \'text\''. It also clarifies the split between textual and non-textual attachments. It does not explicitly name the sibling to use for images, but the context is clear enough for correct selection.

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