iMail-mcp
The iMail-mcp server provides a comprehensive Model Context Protocol (MCP) interface for secure iCloud Mail management through app-specific passwords and TLS/SSL encryption.
Email Operations: Retrieve messages from mailboxes (with optional count/unread filters), send emails with text/HTML content to multiple recipients, mark messages as read, move messages between mailboxes, search with advanced filters (text, sender, date ranges), delete messages, set message flags, and download attachments by message ID and index.
Mailbox Management: List all available mailboxes, create new custom mailboxes, and delete existing ones with built-in safety features preventing deletion of system mailboxes like INBOX or Trash.
Automation: Execute customizable auto-organize rules to automatically move emails based on sender or subject conditions, with optional dry-run mode for testing.
System Tools: Verify configuration status, test IMAP and SMTP server connections, and validate environment variable setup.
Provides comprehensive email management capabilities for iCloud Mail, including reading, sending, and organizing emails, managing mailboxes, handling attachments, searching messages, and automating email organization through IMAP and SMTP integration.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@iMail-mcpshow my 5 most recent unread emails"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
iCloud Mail MCP Server
A Model Context Protocol (MCP) server for integrating with iCloud Mail using App Password authentication. This server provides tools to read, send, and manage emails through iCloud's IMAP and SMTP services.
Development logs for this project are being shared on Hack Club's Summer of Making. Check it out to follow the development journey!
Features
Secure Authentication: Uses App-specific passwords for secure iCloud Mail access
Email Management: Read, send, and organize emails
Mailbox Operations: List mailboxes, mark messages as read
Attachment Support: Handle email attachments
MCP Integration: Seamless integration with MCP-compatible clients
Prerequisites
iCloud Account: You need an active iCloud account with Mail enabled
App Password: Generate an app-specific password for Mail access:
Sign in to appleid.apple.com
Go to "Sign-In and Security" > "App-Specific Passwords"
Generate a new password for "Mail"
Save this password securely
Installation
# Clone the repository
git clone https://github.com/minagishl/icloud-mail-mcp.git
cd icloud-mail-mcp
# Install dependencies using pnpm
pnpm install
# Build the project
pnpm run buildConfiguration
The server requires environment variables to be set for authentication. Configuration is done through your MCP client settings:
Environment Variables (Required)
Add to your MCP server configuration:
{
"icloud-mail-mcp": {
"command": "node",
"args": ["/path/to/icloud-mail-mcp/dist/index.js"],
"env": {
"ICLOUD_EMAIL": "your-email@icloud.com",
"ICLOUD_APP_PASSWORD": "your-app-specific-password"
}
}
}Available Tools
Email Operations
get_messages
Retrieve email messages from a specified mailbox.
Parameters:
mailbox(string, optional): Mailbox name (default: "INBOX")limit(number, optional): Maximum number of messages to retrieve (default: 10)unreadOnly(boolean, optional): Retrieve only unread messages (default: false)
send_email
Send an email through iCloud Mail.
Parameters:
to(string or array, required): Recipient email address(es)subject(string, required): Email subjecttext(string, optional): Plain text email bodyhtml(string, optional): HTML email body
mark_as_read
Mark email messages as read.
Parameters:
messageIds(array, required): Array of message IDs to mark as readmailbox(string, optional): Mailbox name (default: "INBOX")
move_messages
Move messages between mailboxes.
Parameters:
messageIds(array, required): Array of message IDs to movesourceMailbox(string, required): Source mailbox namedestinationMailbox(string, required): Destination mailbox name
search_messages
Search for messages using various criteria.
Parameters:
query(string, optional): Search query text (searches in subject, from, body)mailbox(string, optional): Mailbox name (default: "INBOX")limit(number, optional): Maximum number of messages to retrieve (default: 10)dateFrom(string, optional): Start date for search (YYYY-MM-DD format)dateTo(string, optional): End date for search (YYYY-MM-DD format)fromEmail(string, optional): Filter by sender email addressunreadOnly(boolean, optional): Search only unread messages (default: false)
delete_messages
Delete messages from a mailbox.
Parameters:
messageIds(array, required): Array of message IDs to deletemailbox(string, optional): Mailbox name (default: "INBOX")
set_flags
Set flags on messages (read, unread, flagged, etc.).
Parameters:
messageIds(array, required): Array of message IDs to set flags onflags(array, required): Array of flags to set (e.g., ["\Seen", "\Flagged"])mailbox(string, optional): Mailbox name (default: "INBOX")action(string, optional): Whether to "add" or "remove" the flags (default: "add")
download_attachment
Download an attachment from a specific message.
Parameters:
messageId(string, required): Message ID containing the attachmentattachmentIndex(number, optional): Index of the attachment to download (0-based, default: 0)mailbox(string, optional): Mailbox name (default: "INBOX")
auto_organize
Automatically organize emails based on rules (sender, subject keywords, etc.).
Parameters:
rules(array, required): Array of organization rules with conditions and actionssourceMailbox(string, optional): Source mailbox to organize (default: "INBOX")dryRun(boolean, optional): If true, only shows what would be organized without moving emails (default: false)
Rule Structure:
{
"name": "Rule name",
"condition": {
"fromContains": "sender keyword",
"subjectContains": "subject keyword"
},
"action": {
"moveToMailbox": "destination folder"
}
}Mailbox Management
get_mailboxes
List all available mailboxes in your iCloud Mail account.
Parameters: None
create_mailbox
Create a new mailbox (folder) in your iCloud Mail account.
Parameters:
name(string, required): Name of the mailbox to create
delete_mailbox
Delete an existing mailbox (folder) from your iCloud Mail account.
Parameters:
name(string, required): Name of the mailbox to delete
Safety Features:
Prevents deletion of system mailboxes (INBOX, Sent, Trash, Drafts, Junk)
Validates mailbox name input
Provides detailed error messages for common issues
System Tools
test_connection
Test the email server connection to verify IMAP and SMTP connectivity.
Parameters: None
check_config
Check if environment variables are properly configured and show connection status.
Parameters: None
Usage Example
Getting Started
Start the MCP server:
# With environment variables (recommended)
ICLOUD_EMAIL="your-email@icloud.com" ICLOUD_APP_PASSWORD="your-app-password" pnpm run start
# Or start normally and configure manually
pnpm run startEmail Operations
Get recent messages:
{
"tool": "get_messages",
"arguments": {
"limit": 5,
"unreadOnly": true
}
}Send an email:
{
"tool": "send_email",
"arguments": {
"to": "recipient@example.com",
"subject": "Hello from MCP",
"text": "This email was sent using the iCloud Mail MCP server!"
}
}Move messages between mailboxes:
{
"tool": "move_messages",
"arguments": {
"messageIds": ["message-id-1", "message-id-2"],
"sourceMailbox": "INBOX",
"destinationMailbox": "My Custom Folder"
}
}Mailbox Management
Create a new mailbox:
{
"tool": "create_mailbox",
"arguments": {
"name": "My Custom Folder"
}
}Delete a mailbox:
{
"tool": "delete_mailbox",
"arguments": {
"name": "My Custom Folder"
}
}System Tools
Test connection:
{
"tool": "test_connection",
"arguments": {}
}Check configuration:
{
"tool": "check_config",
"arguments": {}
}Security Notes
App Passwords: Always use app-specific passwords, never your main iCloud password
Secure Storage: Store your app password securely and never commit it to version control
Connection Security: All connections use TLS/SSL encryption
Minimal Permissions: The server only accesses Mail functionality
Development
# Install dependencies
pnpm install
# Run in development mode
pnpm run dev
# Build the project
pnpm run build
# Type checking
pnpm run typecheck
# Run tests
pnpm run test
# Run linting
pnpm run lintTesting
This project includes comprehensive test coverage using Vitest. The test suite covers:
Test Structure
Total Tests: 29 tests across 3 test files
Framework: Vitest with TypeScript support
Coverage: Core functionality, type definitions, and configuration
Test Categories
1. Core Client Tests (src/lib/icloud-mail-client.test.ts)
Constructor validation: Tests client creation with various configurations
Email name extraction: Tests handling of different email formats
Basic functionality: Tests core client behavior and configuration validation
2. Type Definition Tests (src/types/config.test.ts)
iCloudConfig: Tests configuration object structure
EmailMessage: Tests email message data types
SendEmailOptions: Tests email sending parameter validation
SearchOptions: Tests search parameter structures
OrganizationRule: Tests email organization rule definitions
Attachment: Tests attachment data structures
3. Server Configuration Tests (src/index.test.ts)
Environment variables: Tests handling of configuration environment variables
Credential masking: Tests security functions for hiding sensitive data
Config validation: Tests basic configuration validation logic
Running Tests
# Run all tests once
pnpm run test:run
# Run tests in watch mode (interactive)
pnpm run test
# Run tests with UI interface
pnpm run test:uiTest Features
Type Safety: All tests are written in TypeScript without using
anyMocking: External dependencies (IMAP, SMTP) are properly mocked
Coverage: Tests cover both happy path and edge cases
Isolation: Each test is independent and properly cleaned up
Real-world scenarios: Tests reflect actual usage patterns
Troubleshooting
Authentication Issues
Verify your app password is correct and hasn't expired
Ensure two-factor authentication is enabled on your iCloud account
Check that Mail is enabled in your iCloud settings
Connection Problems
Verify internet connectivity
Check if iCloud Mail servers are accessible
Ensure firewall settings allow connections to imap.mail.me.com and smtp.mail.me.com
Email Not Sending
Verify SMTP settings and authentication
Check recipient email addresses are valid
Ensure you're not hitting rate limits
iCloud Mail Server Settings
The server uses the following default settings for iCloud Mail:
IMAP Server: imap.mail.me.com (Port: 993, SSL: Yes)
SMTP Server: smtp.mail.me.com (Port: 587, TLS: Yes)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
14 toolsauto_organizeB
Automatically organize emails based on rules (sender, subject keywords, etc.)
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | If true, only shows what would be organized without moving emails | |
| rules | Yes | Array of organization rules | |
| sourceMailbox | No | Source mailbox to organize (default: INBOX) | INBOX |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'automatically organize' and hints at rules, but doesn't describe what 'organize' entails (e.g., moving emails, potential side effects), authentication needs, rate limits, or error handling. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core functionality ('Automatically organize emails') and adds essential detail ('based on rules...'). There's zero waste, and it's appropriately sized for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (3 parameters, mutation operation, no output schema, and no annotations), the description is minimally adequate. It covers the purpose but lacks behavioral details, usage context, and output expectations. It meets a basic threshold but has clear gaps for effective agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain rule interactions or organizational logic). Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Automatically organize emails based on rules (sender, subject keywords, etc.)'. It specifies the verb ('organize'), resource ('emails'), and mechanism ('rules'), but doesn't explicitly differentiate it from sibling tools like 'move_messages' or 'set_flags' that might also organize emails in different ways.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., existing mailboxes), compare to siblings like 'move_messages' for manual operations, or specify use cases like bulk automation versus single actions. Usage is implied but not articulated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
check_configB
Check if environment variables are properly configured
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It states what the tool does but doesn't disclose behavioral traits like what 'properly configured' means, what happens if configuration is invalid, whether it's read-only or has side effects, or what the output format might be. For a tool with zero annotation coverage, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized for a zero-parameter tool and gets straight to the point.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations, no output schema, and the description's limited behavioral disclosure, this is incomplete for a configuration checking tool. It doesn't explain what 'properly configured' means, what validation criteria are used, or what format the result takes. The description should provide more context about the checking behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters with 100% schema description coverage, so the baseline is 4. The description doesn't need to compensate for any parameter documentation gaps since there are no parameters to document.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: checking if environment variables are properly configured. It uses a specific verb ('check') and resource ('environment variables'), but doesn't differentiate from sibling tools, which are all email-related while this is a configuration tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, timing considerations, or relationship to sibling tools. The context suggests it's for configuration validation, but no explicit usage context is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_mailboxC
Create a new mailbox (folder)
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the mailbox to create |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool creates a mailbox but doesn't describe what happens on success/failure, whether it requires specific permissions, if it's idempotent, or what errors might occur. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise (one short sentence) and front-loaded with the core purpose. Every word earns its place, with no redundant information or fluff. It efficiently communicates the essential action without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given this is a mutation tool (creating a mailbox) with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, idempotency, or error handling, nor does it describe what the tool returns. For a tool that modifies state, more context is needed to use it effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with the single parameter 'name' fully documented in the schema as 'Name of the mailbox to create'. The description adds no additional parameter semantics beyond what the schema provides, such as naming constraints or examples. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Create') and resource ('new mailbox/folder'), making the purpose immediately understandable. It distinguishes from siblings like 'delete_mailbox' and 'get_mailboxes' by specifying creation rather than deletion or retrieval. However, it doesn't explicitly differentiate from all siblings (e.g., 'auto_organize' could also involve mailbox creation).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing proper permissions), when not to use it (e.g., if a mailbox already exists), or direct alternatives among siblings (e.g., using 'get_mailboxes' first to check existence). The agent must infer usage from the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_mailboxC
Delete an existing mailbox (folder)
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the mailbox to delete |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. While 'Delete' implies a destructive mutation, it doesn't specify whether deletion is permanent or reversible, what happens to contained messages, required permissions, or error conditions. This leaves significant gaps for a destructive operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that states the core functionality without unnecessary words. However, it could be more front-loaded with critical behavioral information given the destructive nature of the operation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a destructive mutation tool with no annotations and no output schema, the description is insufficient. It doesn't address what happens after deletion, whether confirmation is needed, error handling, or how this interacts with sibling tools. The context demands more completeness for safe agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents the single 'name' parameter. The description doesn't add any parameter-specific context beyond what's in the schema (e.g., format constraints, examples, or relationship to other tools). Baseline 3 is appropriate when schema does the documentation work.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Delete') and resource ('an existing mailbox (folder)'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'delete_messages' or 'create_mailbox', which would require explicit comparison to earn a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'delete_messages' or 'move_messages'. There's no mention of prerequisites (e.g., mailbox must exist), consequences, or typical scenarios for deletion versus other operations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_messagesC
Delete messages from a mailbox
| Name | Required | Description | Default |
|---|---|---|---|
| mailbox | No | Mailbox name (default: INBOX) | INBOX |
| messageIds | Yes | Array of message IDs to delete |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but only states the basic action without disclosing critical behavioral traits. It doesn't mention whether deletion is permanent or reversible, permission requirements, error handling, or side effects on the mailbox, which are essential for a destructive operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with zero wasted words, making it highly efficient and front-loaded. It directly communicates the core function without unnecessary elaboration, earning its place succinctly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a destructive tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral outcomes, error cases, or return values, leaving significant gaps in understanding how the tool operates and what to expect after invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, fully documenting both parameters, so the description adds no additional parameter information beyond what the schema provides. This meets the baseline for high schema coverage, but doesn't compensate with extra context like format examples or constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Delete') and resource ('messages from a mailbox'), making the purpose immediately understandable. It doesn't differentiate from sibling tools like 'move_messages' or 'delete_mailbox', which would require more specificity about scope or alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'move_messages' or 'delete_mailbox', nor does it mention prerequisites or exclusions. It lacks context about appropriate scenarios, leaving the agent to infer usage from the name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
download_attachmentC
Download an attachment from a specific message
| Name | Required | Description | Default |
|---|---|---|---|
| attachmentIndex | No | Index of the attachment to download (0-based) | |
| mailbox | No | Mailbox name (default: INBOX) | INBOX |
| messageId | Yes | Message ID containing the attachment |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the action but doesn't cover critical aspects like authentication requirements, rate limits, error conditions (e.g., invalid message ID), output format (e.g., file stream vs. metadata), or whether this is a read-only operation. The description is minimal and lacks necessary behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with zero waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (3 parameters, no annotations, no output schema), the description is insufficient. It doesn't explain what the tool returns (e.g., file content, download link), error handling, or operational constraints. For a download operation with multiple inputs, more context is needed to use it effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain relationships between parameters or provide usage examples). Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Download') and target ('an attachment from a specific message'), providing a specific verb+resource combination. However, it doesn't differentiate from potential sibling tools like 'get_messages' which might also retrieve message content, though the focus on attachments is clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid message ID), exclusions, or how it differs from other retrieval tools like 'get_messages' that might include attachments in their output.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_mailboxesB
List all available mailboxes
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'List all available mailboxes,' which implies a read-only operation, but doesn't specify details like whether this requires authentication, returns paginated results, or includes metadata. For a tool with zero annotation coverage, this is a significant gap in behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence ('List all available mailboxes') that is front-loaded and wastes no words. It directly conveys the core purpose without unnecessary elaboration, making it highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks context on usage, behavior, or output, which could be improved for better agent guidance. It meets the minimum viable threshold but has clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0 parameters with 100% coverage, meaning there are no parameters to document. The description doesn't need to add parameter semantics, so it meets the baseline of 4 for tools with no parameters, as it doesn't introduce confusion or omissions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('List') and resource ('all available mailboxes'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'get_messages' or 'search_messages' that might also involve mailbox operations, so it doesn't reach the highest score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or exclusions, such as whether this should be used before other mailbox operations or as a standalone query. This leaves the agent with minimal usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_messagesC
Get email messages from specified mailbox
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of messages to retrieve | |
| mailbox | No | Mailbox name (default: INBOX) | INBOX |
| unreadOnly | No | Retrieve only unread messages |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. While 'Get' implies a read operation, it doesn't specify whether this requires authentication, what format messages are returned in, whether there are rate limits, or how errors are handled. For a tool with 3 parameters and no annotation coverage, this leaves significant behavioral gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that states the core functionality without unnecessary words. It's appropriately sized for a straightforward retrieval tool and gets directly to the point with zero wasted language.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 3 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what format messages are returned in, whether there's pagination, what authentication is required, or how to handle errors. Given the complexity of email retrieval and the lack of structured metadata, the description should provide more operational context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with all parameters well-documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema properties. This meets the baseline expectation when the schema does the heavy lifting, but doesn't provide extra value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Get') and resource ('email messages') with scope ('from specified mailbox'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'search_messages' or 'get_mailboxes', which would require more specific language about what distinguishes this retrieval operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'search_messages' or 'get_mailboxes'. There's no mention of prerequisites, typical use cases, or exclusions that would help an agent choose appropriately among the available email-related tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mark_as_readC
Mark email messages as read
| Name | Required | Description | Default |
|---|---|---|---|
| mailbox | No | Mailbox name (default: INBOX) | INBOX |
| messageIds | Yes | Array of message IDs to mark as read |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the action but doesn't mention permissions required, whether the operation is reversible, error handling, or what happens if invalid message IDs are provided. This is a mutation tool with significant behavioral gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple tool and immediately communicates the core functionality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't address behavioral aspects like side effects, error conditions, or what the tool returns. The context signals indicate this is a non-trivial operation requiring more disclosure.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description doesn't add any additional meaning about the parameters beyond what's in the schema, meeting the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('mark as read') and resource ('email messages'), making the purpose immediately understandable. It doesn't specifically differentiate from sibling tools like 'set_flags' which might also handle read status, but the core action is well-defined.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like 'set_flags' or other email management tools. The description only states what it does, not when it's appropriate or what prerequisites might exist.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
move_messagesC
Move messages between mailboxes
| Name | Required | Description | Default |
|---|---|---|---|
| destinationMailbox | Yes | Destination mailbox name | |
| messageIds | Yes | Array of message IDs to move | |
| sourceMailbox | Yes | Source mailbox name |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Move messages between mailboxes' implies a mutation operation, but it doesn't disclose critical traits such as whether the move is permanent, if it requires specific permissions, what happens to the source messages (e.g., deletion or copying), or potential side effects like updating message IDs. This leaves significant gaps for an agent to understand the tool's behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and resources, making it easy to parse quickly. Every word earns its place without redundancy or unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a mutation tool with no annotations and no output schema, the description is insufficiently complete. It lacks details on behavioral traits (e.g., permanence, permissions), error conditions, or what the tool returns. For a tool that modifies data, this leaves the agent with significant uncertainty about how to use it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with clear descriptions for all three parameters (sourceMailbox, destinationMailbox, messageIds). The description doesn't add any meaning beyond what the schema provides, such as explaining mailbox naming conventions or message ID formats. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Move messages between mailboxes' clearly states the action (move) and the resources (messages, mailboxes), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'delete_messages' or 'set_flags' which also manipulate messages, so it doesn't reach the highest score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., mailboxes must exist), exclusions (e.g., cannot move to non-existent mailboxes), or comparisons to siblings like 'delete_messages' or 'set_flags' for different operations on messages.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_messagesC
Search for messages using various criteria
| Name | Required | Description | Default |
|---|---|---|---|
| dateFrom | No | Start date for search (YYYY-MM-DD format) | |
| dateTo | No | End date for search (YYYY-MM-DD format) | |
| fromEmail | No | Filter by sender email address | |
| limit | No | Maximum number of messages to retrieve | |
| mailbox | No | Mailbox name (default: INBOX) | INBOX |
| query | No | Search query text (searches in subject, from, body) | |
| unreadOnly | No | Search only unread messages |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool searches messages but doesn't describe what happens during execution (e.g., whether it's read-only, if it requires authentication, potential rate limits, or what the output looks like). The phrase 'using various criteria' is vague and doesn't add meaningful behavioral context beyond what the parameters imply.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for a search tool, though it could be slightly more informative without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 7 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain the return values, error conditions, or behavioral traits like whether it's safe to use or has side effects. For a search tool with multiple filtering options, more context is needed to guide effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all 7 parameters with clear descriptions. The description adds no specific parameter information beyond 'various criteria,' which doesn't provide additional meaning or context. This meets the baseline of 3 since the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('search') and resource ('messages'), specifying the action and target. It mentions 'various criteria' which hints at filtering capabilities, but doesn't explicitly differentiate from sibling tools like 'get_messages' or 'auto_organize' that might also retrieve messages.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to prefer search_messages over get_messages (which might retrieve specific messages without filtering) or auto_organize (which might involve searching as part of organization). No context about prerequisites or exclusions is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_emailC
Send an email through iCloud Mail
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | HTML email body | |
| subject | Yes | Email subject | |
| text | No | Plain text email body | |
| to | Yes | Recipient email address(es) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden for behavioral disclosure. It states the action ('Send') but doesn't cover critical aspects like authentication requirements, rate limits, error handling, or whether the email is sent immediately or queued. This is inadequate for a mutation tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for the tool's complexity, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens on success/failure, return values, or behavioral constraints. For a tool that sends emails, more context is needed to use it effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters (to, subject, html, text) with clear descriptions. The description adds no additional parameter information beyond what's in the schema, meeting the baseline for high coverage but not enhancing understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Send') and resource ('email through iCloud Mail'), making the purpose immediately understandable. However, it doesn't distinguish this from potential sibling tools like 'move_messages' or 'set_flags' that might also involve email operations, so it lacks sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication), exclusions, or compare it to sibling tools like 'create_mailbox' or 'delete_messages', leaving the agent with no context for tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
set_flagsC
Set flags on messages (read, unread, flagged, etc.)
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Whether to add or remove the flags (default: add) | add |
| flags | Yes | Array of flags to set (e.g., ["\Seen", "\Flagged"]) | |
| mailbox | No | Mailbox name (default: INBOX) | INBOX |
| messageIds | Yes | Array of message IDs to set flags on |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but only states what the tool does without disclosing behavioral traits. It doesn't mention permission requirements, side effects (e.g., whether flags persist), error handling, or rate limits, which are critical for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose with no wasted words. It uses parentheses to include helpful examples without cluttering the main statement.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral context, error cases, or return values, leaving significant gaps for the agent to operate safely and effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema fully documents all 4 parameters. The description adds minimal value by hinting at flag examples (e.g., 'read, unread, flagged'), but doesn't elaborate beyond what the schema provides, meeting the baseline for high coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Set') and resource ('flags on messages'), with examples of specific flags like 'read, unread, flagged'. It distinguishes from siblings like 'mark_as_read' by covering multiple flag types, though it doesn't explicitly contrast with them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like 'mark_as_read' or 'auto_organize'. The description mentions flag types but doesn't specify scenarios or prerequisites for usage, leaving the agent to infer context from parameter names alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
test_connectionB
Test the email server connection (IMAP and SMTP)
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Test') but doesn't reveal critical traits: whether this is a read-only diagnostic, if it requires authentication, potential side effects (e.g., network traffic), error handling, or output format. This is inadequate for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and includes relevant technical details (IMAP and SMTP) without fluff, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of testing server connections, the description is incomplete. With no annotations and no output schema, it fails to explain what the test entails, what results to expect (e.g., success/failure indicators), or behavioral aspects like timeouts or retries. This leaves significant gaps for an agent to use the tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add param info, but that's unnecessary here. A baseline of 4 is appropriate as it avoids redundancy while the schema fully handles the lack of parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Test the email server connection (IMAP and SMTP).' It specifies the verb ('Test') and the resource ('email server connection'), with additional detail about the protocols involved. However, it doesn't explicitly differentiate from sibling tools like 'check_config', which might have overlapping functionality, preventing a score of 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., after configuration changes), exclusions, or comparisons to siblings like 'check_config', leaving the agent with minimal context for decision-making.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
14 tool updates
- First observed
auto_organize - First observed
check_config - First observed
create_mailbox - First observed
delete_mailbox - First observed
delete_messages - First observed
download_attachment - First observed
get_mailboxes - First observed
get_messages - First observed
mark_as_read - First observed
move_messages - First observed
search_messages - First observed
send_email - First observed
set_flags - First observed
test_connection
TDQS
Scored across 14 tools
Each tool has a clearly distinct purpose with no significant overlap. For example, 'get_messages' retrieves emails, 'search_messages' finds specific ones, and 'move_messages' relocates them, while 'mark_as_read' and 'set_flags' handle different message states. The descriptions clearly differentiate their functions, making misselection unlikely.
All tool names follow a consistent verb_noun pattern using snake_case, such as 'get_mailboxes', 'create_mailbox', and 'delete_messages'. There are no deviations in style or convention, making the set predictable and easy to parse for an agent.
With 14 tools, this server is well-scoped for email management, covering core operations like sending, organizing, and retrieving emails, along with configuration and connection checks. Each tool serves a distinct function, and the count aligns with the domain's complexity without being overwhelming.
The tool set provides comprehensive coverage for email management, including CRUD operations (e.g., create/delete mailboxes, send/delete messages), lifecycle handling (mark as read, set flags), organization (move, auto_organize), and utility functions (test connection, check config). There are no obvious gaps that would hinder an agent's workflow.
Related MCP Connectors
- mailOAuthcom.anymailmcp
Read, send, organize, watch email on any IMAP mailbox: Gmail, iCloud, OVH, Zoho, Fastmail + CalDAV.
Your mailboxes in ChatGPT and Claude: Gmail, iCloud, Fastmail, any IMAP. Passwords stay yours.
Read, send, file and search email in any Gmail, Microsoft 365 or IMAP mailbox, plus its calendar.
- Lettio MCPOAutheu.lettio
Private, EU-hosted email for AI agents over JMAP: read, search, reply, organize, send.