getAttachment
getAttachmentRead an attachment's saved extracted text as Markdown in chunks, including metadata and local file paths. Use the same connection, key, and file with nextOffset to continue long text.
Instructions
Read an attachment's saved extracted text as Markdown, in chunks, with its metadata and local file paths. This reads existing text; it does not convert the file on demand. If text is absent, extracted text is unavailable, not proof that the original attachment is empty. The original may still be available at path; path is absent if the file is missing.
Get file from getMessage's attachments[].file or a search hit's snippetAttachmentFile, keeping that message's connection and key. To continue a long text, call this tool again with the same connection, key and file and offset=nextOffset. Stop when there is no nextOffset.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Local key of the message containing this attachment, from getMessage or the search hit; use the same connection | |
| file | Yes | Exact attachments[].file from getMessage or snippetAttachmentFile from search for this message. Use this value unchanged, not name, path or textPath | |
| offset | No | Text character offset, default 0. Use nextOffset from this tool to continue this attachment, not an offset from message-body or search results | |
| maxChars | No | Text characters per chunk: 1 to 100000, default 20000; larger values are capped at 100000 | |
| connection | Yes | Connection name from listConnections |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Message key. | |
| file | Yes | Attachment file, as requested. | |
| name | No | Original file name. | |
| path | No | Absolute path of the original file; absent when it is not saved. | |
| size | Yes | Size in bytes. | |
| text | No | Chunk of the saved extracted text as Markdown; [redacted:<kind>] marks a hidden secret. Absent when extracted text is unavailable; the original attachment may still have content and be available at path. | |
| offset | Yes | Character position of this chunk. | |
| textPath | No | Absolute path of the extracted Markdown text; absent when there is no text. | |
| nextOffset | No | Pass as offset to get the next chunk; absent at the end. | |
| textLength | Yes | Length of the whole text in characters; 0 without text. | |
| contentType | Yes | MIME type, e.g. application/pdf. |