Skip to main content
Glama
grammy-mcp
by louietyj

getFile

Read-only

Retrieve basic Telegram file info and a download link valid for at least one hour; use the returned file_path to download files up to 20MB.

Instructions

Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.

Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.

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": {
      "file_id": "<file_id>"
    },
    "name": "getFile"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_idYesFile identifier to get info about

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and openWorldHint, yet the description adds substantial non-obvious behavior: the 20MB cap, the 1-hour minimum link validity, link expiry and re-request semantics, and the caveat that the original file name and MIME type may not be preserved. It also explains how to construct the download URL from the returned file_path, which the agent cannot infer from annotations alone.

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?

The main behavior is front-loaded in the first two sentences and the caveats follow logically. The separate 'Note' is justified because it warns of a real pitfall (lost file name/MIME type), though the download-URL sentence is slightly long relative to its value.

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?

There is no output schema, so the description carries the burden of describing the returned File object, the file_path field, and URL construction — all of which it does. Combined with the size limit, expiry window, and naming caveat, an agent has everything needed to call it and use the result correctly.

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 coverage is 100% for the single file_id parameter, so the schema already carries the meaning. The description adds no further detail about file_id format or how to obtain it, which is acceptable at the baseline given full coverage but earns no extra credit.

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?

The description opens with a specific verb and resource: 'get basic info about a file and prepare it for downloading.' That is concrete and actionable. It does not explicitly contrast with any sibling (none of the listed siblings share this function), so it lands at a clear-but-undifferentiated 4 rather than a 5.

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?

It gives clear operational context: the 20MB bot download limit, the requirement to use the returned file_path with the api.telegram.org/file URL, and the instruction to call getFile again once the link expires. It stops short of naming alternatives or exclusions, but no sibling in the list appears to overlap.

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

Deploy Server

Other Tools