Folder statistics
folder_statsGet exact total and unread message counts for a mail folder, plus scanned aggregations such as oldest/newest dates and total bytes, with scanned/truncated flags revealing partial results.
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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "folder_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. |