| name | email-manager |
| description | Manages Microsoft 365 emails: analyze inbox, categorize by business relevance, create actionable tables, move emails to folders, and forward messages. Uses MS365 MCP server for email operations. |
Email Manager Skill
This skill provides comprehensive email management capabilities using the Microsoft 365 MCP server.
Core Capabilities
-
Email Analysis & Categorization
- Retrieve emails from specific time periods
- Categorize by business relevance (sales, administrative, spam)
- Create structured tables with sender, subject, relevance, and action items
- Priority ranking for sales-relevant contacts
-
Email Organization
- Move emails to specific folders (Archive, Rechnungen, etc.)
- Batch operations for organizing multiple emails
- Smart folder detection and management
-
Email Forwarding
- Forward individual or multiple emails
- Preserve original formatting and content
- Add forwarding context when needed
MCP Server Integration
This skill uses the MS365 MCP Server which provides Microsoft 365/Outlook integration.
Configuration
The MS365 MCP server must be configured in .mcp.json:
{
"mcpServers": {
"ms365": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-server-ms365@latest"]
}
}
}
Authentication
The MS365 MCP server uses OAuth2 device code flow:
- First call to any MS365 tool triggers authentication
- User receives device code and URL
- User authorizes on Microsoft's website
- Token is cached for future use
Check authentication status:
mcp__ms365__verify-login
Available Tools
Email Retrieval & Search
mcp__ms365__list-mail-messages
mcp__ms365__get-mail-message
- Get full details of a specific email
- Returns complete message including body, attachments, metadata
- Supports expand/select for specific fields
mcp__ms365__list-mail-folder-messages
- List emails from specific folder
- Same filtering capabilities as list-mail-messages
- Useful for browsing organized emails
Folder Management
mcp__ms365__list-mail-folders
- Get all available email folders
- Returns folder IDs, names, counts
- Identify target folders for organization
mcp__ms365__move-mail-message
- Move email to different folder
- Requires message ID and destination folder ID
- Atomic operation with error handling
Email Actions
mcp__ms365__send-mail
- Send new email or forward existing email
- Supports HTML and text content
- Attachments, CC, BCC support
- Save to sent items optional
mcp__ms365__delete-mail-message
- Delete specific email
- Moves to "Deleted Items" folder
- Permanent deletion requires additional step
mcp__ms365__create-draft-email
- Create email draft without sending
- Edit later or send programmatically
Search
mcp__ms365__search-query
- Advanced search across mailbox
- Full-text search in subject, body, attachments
- Complex query syntax support
Common Workflows
1. Analyze Recent Emails
mcp__ms365__list-mail-messages({
filter: "receivedDateTime ge 2025-11-05T00:00:00Z",
select: ["id", "subject", "from", "receivedDateTime", "bodyPreview"],
orderby: ["receivedDateTime desc"],
top: 100
})
2. Organize Invoices
mcp__ms365__list-mail-messages({
filter: "contains(subject, 'Rechnung') or contains(subject, 'Invoice')"
})
mcp__ms365__list-mail-folders()
mcp__ms365__move-mail-message({
messageId: "email-id",
body: { DestinationId: "rechnungen-folder-id" }
})
3. Forward Invoices
mcp__ms365__get-mail-message({ messageId: "invoice-id" })
mcp__ms365__send-mail({
body: {
Message: {
subject: "FW: " + original.subject,
body: { contentType: "html", content: original.body.content },
toRecipients: [{ emailAddress: { address: "recipient@example.com" }}]
},
SaveToSentItems: true
}
})
Best Practices
-
Date Filtering: Always use ISO 8601 format for dates
2025-11-05T00:00:00Z (UTC timezone)
- Use
receivedDateTime ge for "since" queries
-
Field Selection: Use select parameter to reduce response size
- Only request fields you need
- Reduces token usage significantly
-
Error Handling:
- 404 errors: Email already moved/deleted
- Large responses: Use pagination or field selection
- Authentication: Check login status first
-
Batch Operations:
- Process emails in parallel when possible
- Use TodoWrite to track multi-email operations
- Handle individual failures gracefully
-
Folder Operations:
- Always verify folder IDs before moving
- Cache folder list to avoid repeated lookups
- Use folder names as fallback for user-friendly messages
Example: Full Email Analysis Workflow
mcp__ms365__verify-login()
const emails = await mcp__ms365__list-mail-messages({
filter: "receivedDateTime ge 2025-11-05T00:00:00Z",
select: ["id", "subject", "from", "receivedDateTime", "bodyPreview"],
top: 100
})
const categorized = {
business: [],
administrative: [],
spam: []
}
for (const email of emails) {
const sender = email.from.emailAddress.address
const subject = email.subject
if (isKnownClient(sender) || containsSalesKeywords(subject)) {
categorized.business.push({
sender: email.from.emailAddress.name,
subject: subject,
relevance: "HIGH",
todo: determineTodo(email)
})
} else if (isAdministrative(subject)) {
categorized.administrative.push(email)
} else {
categorized.spam.push(email)
}
}
const table = createMarkdownTable(categorized.business)
await organizeEmails(categorized)
Performance Considerations
-
Token Usage: Email bodies can be large (10K+ tokens)
- Use
select to limit fields
- Use
excludeResponse: true when only success/failure matters
- Paginate large result sets
-
Rate Limits: Microsoft Graph API has rate limits
- Batch operations when possible
- Add delays for very large operations
- Handle 429 (Too Many Requests) errors
-
Parallel Operations: Most operations can be parallelized
- Multiple
get-mail-message calls in parallel
- Multiple
move-mail-message calls in parallel
- Do NOT parallelize operations that depend on each other
Troubleshooting
Authentication Issues
- Run
mcp__ms365__verify-login to check status
- Re-authenticate if token expired
- Check
.mcp.json configuration
Email Not Found (404)
- Email may have been moved/deleted already
- Verify message ID is correct
- Check if email is in different folder
Response Too Large
- Use
excludeResponse: true parameter
- Select only needed fields with
select
- Reduce
top parameter for pagination
Folder Not Found
- Run
list-mail-folders to verify folder structure
- Use exact folder ID from list response
- Note: Folder names may differ from display names