get_message_document
Download and extract text from a document attached to a specific Telegram message. Provide chat entity and message ID to get the file's content along with metadata like filename and MIME type.
Instructions
Download and extract text from a document attached to a specific message.
Args: entity: Chat username (e.g. @some_channel), chat ID. message_id: The ID of the message that contains the document.
Returns: Dict with filename, mime_type, size_bytes, and content (extracted text), or an error field if extraction is not possible.
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": {
"entity": "<entity>",
"message_id": "<message_id>"
},
"name": "get_message_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity | Yes | ||
| message_id | Yes |