fetch_part
Fetch a specific MIME part from an email by part number. Returns decoded text for text parts or base64-encoded binary data for attachments.
Instructions
Fetch a specific MIME part of an email by part number.
Part numbers come from inspect_email's parts list (e.g. "1", "2.1").
For text parts with decode=True (default), returns the decoded string
body. For binary parts or decode=False, returns base64-encoded bytes
so the result is JSON-safe.
Args: folder: Folder containing the email email_id: UID of the email part_number: Part identifier from inspect_email (e.g. "1", "2.1") decode: If True, decode text parts to str; otherwise return base64
Returns dict with content (str or base64) + encoding marker.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | Yes | ||
| email_id | Yes | ||
| part_number | Yes | ||
| decode | No |