This skill should be used when moving a single email message to the Archive folder in Microsoft 365 Mail. It provides a clean interface to move one specific email using its messageId without polluting the context window. Use this skill when processing bulk archive operations, moving spam emails, or any workflow requiring reliable one-email-at-a-time moves to Archive.
This skill ONLY works when executed within Claude Agent context (bassi, Claude Code, or other Claude Agent environments).
The Python script (scripts/move_to_archive.py) is a parameter preparation tool, not a standalone email mover. It prepares parameters that Claude's tool system then executes.
Move one specific email message to the Archive folder in Microsoft 365 Mail with a clean, context-efficient interface.
For a single email move, use the MS365 mail API directly with these parameters:
Function: mcp__ms365__move-mail-message
Required Parameters:
messageId: The unique message ID of the email to move (string)body: JSON object with destination folder IDOptional Parameter:
references/archive_config.md unless overriding# Minimum parameters needed (within Claude agent context)
messageId = "AAMkADA4YjhhZDYwLWZiMWYtNDVkMy1hNjE3LWI3YzRlMzAwNGE0MgBGAAA..."
archive_folder_id = "AQMkADA4YjhhZDYwLWZiMWYtNDVkMy1hNjE3LWI3YzRlMzAwADRhNDIALgAAA-cCSmDe9C5Ai1IxFty3vKgBACIai-AjXXpFuMeLL-NexTAAAAIBVAAAAA=="
response = mcp__ms365__move-mail-message(
messageId=messageId,
body={"DestinationId": archive_folder_id}
)
Critical Finding: Moving emails individually (one per call) works reliably. Batch operations cause ErrorInvalidIdMalformed errors. Always move ONE email per operation call.
Use scripts/move_to_archive.py to prepare parameters. This script:
What it does: Returns the parameters Claude needs to execute the move What it does NOT do: Move emails directly (requires Claude context)
Usage:
python scripts/move_to_archive.py --message-id "AAMkADA4YjhhZDYwLWZiMWYtNDVkMy1h..." [--archive-id "custom-id"]
Output:
{
"status": "ready",
"operation": {
"api_function": "mcp__ms365__move-mail-message",
"parameters": {
"messageId": "AAMkADA4YjhhZDYwLWZiMWYtNDVkMy1h...",
"body": {
"DestinationId": "AQMkADA4YjhhZDYwLWZi..."
}
}
}
}
references/api_docs.md for full MS365 Mail API parameter detailsreferences/archive_config.md for Archive folder ID and defaultsAQMkADA4YjhhZDYwLWZiMWYtNDVkMy1hNjE3LWI3YzRlMzAwADRhNDIALgAAA-cCSmDe9C5Ai1IxFty3vKgBACIai-AjXXpFuMeLL-NexTAAAAIBVAAAAA==Success response includes:
id: Email ID (confirming which email was moved)parentFolderId: Archive folder ID (confirming destination)subject: Email subject (for reference)receivedDateTime: When email was receivedIndicates Success: parentFolderId equals the Archive folder ID
| Error | Cause | Solution |
|---|---|---|
ErrorInvalidIdMalformed | Invalid or malformed message ID | Verify message ID from current email list response |
ErrorItemNotFound | Email no longer exists | Refresh email list; may have been deleted |
ErrorAccessDenied | Permission issue | Verify authenticated user has Archive folder access |
| Wrong parentFolderId | Incorrect Archive folder ID | Verify folder ID from references/archive_config.md |
| Script doesn't move emails | Running outside Claude context | Ensure script runs within Claude agent environment |
For archiving multiple emails without polluting context:
See .claude/agents/bulk-archive-agent.md and .claude/agents/BULK_ARCHIVE_TASK_TEMPLATE.md for:
Quick Example:
Main Context: "Archive 50 emails"
→ Launch bulk-archive sub-agent with message IDs
→ Sub-agent moves silently (one at a time)
→ Returns: "✅ Archived 48 emails. ❌ 2 failed."
Result: Clean context, 1 summary line instead of 50 confirmations
Single Email Move (use skill directly):
User request → Direct API call → Archive → Done (inline, context stays clean)
Bulk Email Move (use sub-agent):
User request → Identify emails → Launch sub-agent → Sub-agent archives silently → Summary to context
↓
(50+ operations happen here,
context stays clean)