Mail Folders
foldersManage Outlook mailbox directories: list the hierarchy, create nested paths, move messages, get unread counts, or delete safely with a dry-run preview.
Instructions
Manage mail folders. Address a folder by name, by slash-separated path for nested folders (e.g. Inbox/Clients/Acme, case-insensitive) or by ID; a bare name matches a unique top-level folder first, then nested ones (an ambiguous name returns the candidates). action=list (default) returns the tree with each folder's path and id (includeItemCounts, includeChildren). action=create makes name under the root or parentFolder/parentFolderId. action=move moves emailIds into targetFolder/targetFolderId. action=stats returns total/unread counts for folder or folderId. action=delete removes a folder (folderName/path or folderId) with everything in it, subfolders included. It skips Deleted Items and Graph documents no restore path, so pass dryRun: true first to see what would be lost. Protected folders (Inbox, Sent Items, etc.) can't be deleted. Every action accepts sharedMailbox (alias email) to work in a shared or delegated mailbox (default: your own).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name of the folder to create (action=create, required) | |
| No | Alias for `sharedMailbox`. | ||
| action | No | Action to perform (default: list) | |
| dryRun | No | Preview only (action=delete): nothing is deleted. Shows the folder and how many items and subfolders would be lost. Other actions refuse dryRun and change nothing. Default false. | |
| folder | No | Folder name or path (inbox, sent, "Triage/Delete", etc.). Default: inbox (action=stats) | |
| emailIds | No | Comma-separated list of email IDs to move (action=move, required) | |
| folderId | No | Folder ID (action=stats/delete) | |
| folderName | No | Folder name or path to delete — resolved to ID (action=delete). Cannot delete protected folders (Inbox, Drafts, Sent, etc.) | |
| parentFolder | No | Parent folder name or path (e.g. "Clients/Acme"); default is root (action=create) | |
| sourceFolder | No | Ignored: action=move moves each email by ID from wherever it is. Accepted for older callers. | |
| targetFolder | No | Destination folder name or path, e.g. "Triage/Delete" (action=move; or use targetFolderId) | |
| sharedMailbox | No | Email address of a shared/delegated mailbox to target (all actions; default: the signed-in account). Requires delegate access + Mail.Read.Shared (list/stats) or Mail.ReadWrite.Shared (create/move/delete). Work/school only; needs the server opt-in setting OUTLOOK_SHARED_MAILBOX (otherwise the call is refused with setup guidance). | |
| parentFolderId | No | Parent folder ID — alternative to parentFolder for unambiguous targeting (action=create) | |
| targetFolderId | No | Destination folder ID — alternative to targetFolder for unambiguous/nested targeting (action=move) | |
| includeChildren | No | Include child folders in hierarchy (action=list) | |
| outputVerbosity | No | Output detail level (action=stats, default: standard) | |
| includeItemCounts | No | Include counts of total and unread items (action=list) |