getMessage
getMessageReads a locally stored email message, returning headers, a Markdown body chunk, and its attachment list; use the next offset to continue retrieving body text.
Instructions
Read one locally stored message: headers, a body chunk as Markdown, and an attachment list. nextOffset continues only the body; headers and the attachment list are returned on each call. If body is absent, saved body text is unavailable; inspect state and error rather than assuming the original message was empty.
To read an attachment, call getAttachment with the same connection and key, and file=attachments[].file. Use file, not name or path. The list includes files extracted from attached archives and messages; parent is the containing attachment's file. For the conversation, call getThread with the same connection and key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Local message key from listMessages, search or getThread in this connection; use key, not the Message-ID header | |
| offset | No | Body character offset, default 0. To continue, keep the same connection and key and use nextOffset from this tool. Stop when there is no nextOffset | |
| maxChars | No | Body 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 |
|---|---|---|---|
| cc | No | Cc recipients as Name <address>. | |
| to | No | To recipients as Name <address>. | |
| key | Yes | Message key. | |
| body | No | Chunk of the saved body as Markdown; [redacted:<kind>] marks a hidden secret. Absent when saved body text is unavailable; this does not prove the original body was empty. | |
| date | No | Date from the message header; absent when missing. | |
| from | No | Senders as Name <address>. | |
| read | No | Read in the mailbox as of the last sync; absent when unknown. | |
| error | No | Why the message failed; present when state is failed. | |
| state | Yes | converted (complete), downloaded (saved, text not processed yet) or failed (see error). | |
| folder | Yes | Folder path in the mailbox; not the folder key used by listMessages/search. | |
| labels | No | Mailbox labels of this message as of the last sync, such as Gmail's Inbox, Sent or user labels; empty when it has none. Absent when unknown or when the mailbox has no labels. | |
| offset | Yes | Character position of this chunk. | |
| flagged | No | Flagged or starred in the mailbox as of the last sync (not sender importance); absent when unknown. | |
| subject | No | Subject. | |
| inReplyTo | No | In-Reply-To header. | |
| localPath | Yes | Absolute message directory, readable directly: message.eml (original), body.md, attachments/. | |
| messageId | No | Message-ID header. | |
| bodyLength | Yes | Length of the whole body in characters; 0 without a body. | |
| nextOffset | No | Pass as offset to get the next chunk; absent at the end. | |
| references | No | References header message IDs. | |
| attachments | Yes | Attachments, including files unpacked from attached archives and messages. Empty when none are found or the saved MIME cannot be read. Pass an entry's file to getAttachment with this message's key and connection. |