Read mail attachment
mail_read_attachmentRead email attachments by content type: text, PDF, images, office documents, and calendar invitations. Requires message ID and part index from mail_list_attachments.
Instructions
Read one attachment: text, PDF, image, office document or calendar invite.
Dispatches by content type: text/* and PDF (via pdftotext) come back as text; image/* comes back as an actual image the model can look at (downscaled if oversized and Pillow is installed, otherwise refused with its size); office documents (doc/docx/odt/rtf) are converted to text via pandoc or libreoffice; calendar invitations (text/calendar, .ics) are rendered as a readable summary (method, time, location, organizer, attendees with their response status). Call mail_list_attachments first to get a valid part_index. Archives and other binary formats are not supported and raise an explanatory error.
Args: message_id: A Message-ID as seen in mail_search/mail_read_thread output. part_index: The 1-based part index from mail_list_attachments.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | ||
| part_index | Yes |