download_attachment
Downloads one selected Telegram attachment (ID from get_messages or get_album) up to 20 MiB, returning a local file path and ResourceLink instead of inline bytes.
Instructions
Download one explicitly selected attachments[].id, up to 20 MiB.
Requires allow_attachment_downloads and ordinary source-read permission. Use
get_messages or get_album to select an attachment first. The ID selects the current
attachment at that message, not an archived version. Protected and expiring media
cannot be downloaded. Returns a local path and a ResourceLink, without inline bytes;
use resources/read before expires_at to retrieve binary content. Files expire after
15 minutes or server shutdown. The local path is on the server computer. Temporary
failures require retrying this call; respect retry_after_seconds. No partial resume.
save=true retains a permanent copy when archive_directory is configured.
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": {
"attachment_id": "<attachment_id>"
},
"name": "download_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save | No | ||
| attachment_id | Yes |