Export
tg_exportExport a Telegram chat's complete file list or message history to CSV, JSON, JSONL, or Markdown in the background, returning a task ID and output path for later reading.
Instructions
Export a chat's complete file list (what=files) or message history (what=messages) to csv/json/jsonl/md in the background. Returns task_id and output_path; read the file when the task is done.
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": {
"chat": "<chat>"
},
"name": "tg_export"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | Yes | Chat: @username, username, t.me link, t.me/c/<id> link, or numeric id such as -100123… | |
| what | No | files | |
| limit | No | Max rows; omit for all | |
| since | No | Start date, ISO (e.g. 2025-01-01). | |
| types | No | File kinds. Default: everything except stickers. | |
| until | No | End date, ISO. | |
| format | No | csv | |
| account | No | Account id (see tg_list_accounts). Defaults to the default account. | |
| extensions | No | Extensions, e.g. ["zip", "mp4"]. | |
| max_size_mb | No | ||
| min_size_mb | No | ||
| oldest_first | No | ||
| name_contains | No | File name or caption contains (case-insensitive). |