Tool Categories
Account Management
Tools for discovering and verifying IMAP accounts.imap_list_accounts
List configured accounts without exposing secrets
imap_verify_account
Verify account connectivity, auth, and capabilities
imap_list_mailboxes
List visible mailboxes/folders
Message Operations
Tools for searching, reading, and retrieving messages.imap_search_messages
Search mailbox with filters and pagination
imap_get_message
Get parsed message details with optional enrichments
imap_get_message_raw
Get bounded RFC822 source for diagnostics
Write Operations
Tools for modifying messages and mailboxes. All write operations requireMAIL_IMAP_WRITE_ENABLED=true.
imap_update_message_flags
Add/remove IMAP flags on a message
imap_copy_message
Copy message to mailbox in same or different account
imap_move_message
Move message to mailbox in same account
imap_delete_message
Delete message from mailbox
Shared Input Types
All tools accept these common input parameters with consistent validation rules.account_id
- Type: string
- Pattern:
^[A-Za-z0-9_-]{1,64}$ - Default:
"default"
MAIL_IMAP_<ACCOUNT>_.
mailbox
- Type: string
- Length: 1..256 characters
"INBOX", "Sent", "Archive/2024").
message_id
- Type: string
- Format:
imap:{account_id}:{mailbox}:{uidvalidity}:{uid}
- Prefix must be
imap uidvalidityanduidmust be non-negative integers- Parsed
account_idmust match requested account
imap:default:INBOX:1234567890:42
limit
- Type: integer
- Range: 1..50
- Default: 10
Shared Output Envelope
All tools return a consistent envelope structure with three sections:Success Response
Error Response
Partial Success Response
Runtime IMAP command failures are returned in successfuldata payloads to preserve partial results:
ok- operation completed successfullypartial- operation completed with some failuresfailed- operation failed completely
Error Codes
The server returns consistent error codes in theerror.code field:
| Code | Description | When Used |
|---|---|---|
invalid_input | Input validation failed | Malformed parameters, conflicting options, out-of-range values |
auth_failed | Authentication failed | Invalid credentials, expired password, account locked |
not_found | Resource not found | Non-existent message_id, mailbox, or account |
timeout | Operation timed out | IMAP server unresponsive, network issues |
conflict | State conflict detected | Cursor expired, UIDVALIDITY changed, mailbox deleted |
internal | Internal server error | Unexpected failures, parser errors, resource exhaustion |
Common Validation Errors
invalid_input: conflicting parameters
invalid_input: conflicting parameters
invalid_input: malformed message_id
invalid_input: malformed message_id
conflict: cursor expired
conflict: cursor expired
not_found: message deleted
not_found: message deleted
Write Gate
Write operations (imap_update_message_flags, imap_copy_message, imap_move_message, imap_delete_message) are disabled by default and must be explicitly enabled:
Next Steps
Account Management
Start with account discovery and verification
Search Messages
Learn about search filters and pagination
Configuration
Configure accounts via environment variables
Quick Start
Get started with your first IMAP account