folder_stats
Get aggregate stats for a Proton Mail folder: total and unread counts, plus oldest/newest dates and total bytes from scanned envelopes. Handles partial results with truncation detection.
Instructions
Return aggregate stats for a folder: total/unread (free), plus scanned-envelope aggregations (oldest/newest/total bytes). Default scanLimit 5000, max 20000. Response always includes scanned/truncated so callers can detect partial results. A non-selectable namespace container (e.g. Folders/Labels) is rejected with an actionable error rather than reporting empty stats.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Folder to analyze (default: INBOX). | INBOX |
| scanLimit | No | Max number of message envelopes to scan for the aggregations (oldest/newest date, total bytes), 1–20000 (default: 5000). Total/unread counts are always exact; only the scanned aggregations are capped. The response reports `scanned` and `truncated` so you know if the cap was hit — raise this for large folders if you need exact min/max dates. |