Skip to main content
Glama
ai-zerolab

MCP Email Server

by ai-zerolab

add_email_account

Configure a new email account in the MCP Email Server by setting up IMAP and SMTP connection details for automated email workflows.

Instructions

Add a new email account configuration to the settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'add_email_account' tool, registered via @mcp.tool decorator. Adds the EmailSettings to config and persists it.
    @mcp.tool(description="Add a new email account configuration to the settings.")
    async def add_email_account(email: EmailSettings) -> str:
        settings = get_settings()
        settings.add_email(email)
        settings.store()
        return f"Successfully added email account '{email.account_name}'"
  • Pydantic BaseModel defining the input schema EmailSettings used by the tool handler.
    class EmailSettings(AccountAttributes):
        full_name: str
        email_address: str
        incoming: EmailServer
        outgoing: EmailServer
        save_to_sent: bool = True  # Save sent emails to IMAP Sent folder
        sent_folder_name: str | None = None  # Override Sent folder name (auto-detect if None)
  • Method on Settings class that appends the new email account to the emails list, triggering validation.
    def add_email(self, email: EmailSettings) -> None:
        """Use re-assigned for validation to work."""
        self.emails = [email, *self.emails]
  • Method on Settings class that serializes and writes the configuration to the TOML file.
    def store(self) -> None:
        toml_file = self.model_config["toml_file"]
        toml_file.parent.mkdir(parents=True, exist_ok=True)
        toml_file.write_text(self._to_toml())
        logger.info(f"Settings stored in {toml_file}")
  • Function that provides the singleton instance of Settings, loading from config.toml if needed.
    def get_settings(reload: bool = False) -> Settings:
        global _settings
        if not _settings or reload:
            logger.info(f"Loading settings from {CONFIG_PATH}")
            _settings = Settings()
        return _settings
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is an 'Add' operation, implying creation/mutation, but doesn't describe side effects (e.g., whether this persists configuration, requires authentication, or has rate limits). For a mutation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It's appropriately front-loaded with the core action and resource, making it efficient for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation operation with a nested parameter structure, no annotations, and an output schema), the description is inadequate. It doesn't explain what 'email account configuration' includes, behavioral traits, or usage context, relying too heavily on the schema and output schema without compensatory guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'email account configuration' but provides no details about what that entails. With 0% schema description coverage and 1 parameter (a complex nested object with 10+ sub-properties), the description fails to add any meaningful semantics beyond the schema's structure, leaving parameters undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add') and resource ('email account configuration to the settings'), making the purpose understandable. It doesn't explicitly differentiate from sibling tools like 'list_available_accounts', but the verb 'Add' distinguishes it from read-only operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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. It doesn't mention prerequisites (e.g., whether an account must not already exist), nor does it reference sibling tools like 'list_available_accounts' for checking existing accounts before adding.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ai-zerolab/mcp-email-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server