Skip to main content
Glama
Michaelzag

Migadu MCP Server

by Michaelzag

list_identities

Read-onlyIdempotent

Retrieve email identities for a mailbox to view summaries, statistics, and sample data for managing email configurations.

Instructions

List email identities for mailbox. Returns summary with statistics and samples.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mailboxYes
domainNo

Implementation Reference

  • The main execution logic for the 'list_identities' tool: resolves domain, logs operation, calls IdentityService.list_identities(), and handles errors.
    async def list_identities(
        mailbox: str, ctx: Context, domain: str | None = None
    ) -> Dict[str, Any]:
        """List email identities for mailbox. Returns summary with statistics and samples."""
        if domain is None:
            from migadu_mcp.config import get_config
    
            config = get_config()
            domain = config.get_default_domain()
            if not domain:
                raise ValueError("No domain provided and MIGADU_DOMAIN not configured")
    
        await log_operation_start(ctx, "Listing identities", f"{mailbox}@{domain}")
        try:
            service = get_service_factory().identity_service()
            result = await service.list_identities(domain, mailbox)
            count = len(result.get("identities", []))
            await log_operation_success(
                ctx, "Listed identities", f"{mailbox}@{domain}", count
            )
            return result
        except Exception as e:
            await log_operation_error(
                ctx, "List identities", f"{mailbox}@{domain}", str(e)
            )
            raise
  • The @mcp.tool decorator registers the list_identities function as an MCP tool with specific annotations, within register_identity_tools().
    @mcp.tool(
        annotations={
            "readOnlyHint": True,
            "idempotentHint": True,
            "openWorldHint": True,
        },
    )
    @with_context_protection(max_tokens=2000)
  • Supporting service method in IdentityService that makes the actual Migadu API GET request to retrieve the list of identities.
    async def list_identities(self, domain: str, mailbox: str) -> Dict[str, Any]:
        """List all identities for a mailbox"""
        return await self.client.request(
            "GET", f"/domains/{domain}/mailboxes/{mailbox}/identities"
        )
  • Initialization call to register_identity_tools(mcp), which in turn registers the list_identities tool among others.
    register_mailbox_tools(mcp)
    register_identity_tools(mcp)
    register_alias_tools(mcp)
    register_rewrite_tools(mcp)
    register_resources(mcp)
Behavior4/5

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

Annotations already indicate read-only, open-world, and idempotent behavior. The description adds value by specifying the return format ('summary with statistics and samples'), which isn't covered by annotations. It doesn't contradict annotations, as listing aligns with read-only operations.

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, efficient sentence that front-loads the core purpose and includes output details. Every word contributes meaning without redundancy, making it appropriately concise.

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

Completeness3/5

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

Given the annotations cover safety and behavior well, and there's no output schema, the description adequately explains the tool's function. However, it lacks details on parameter usage and doesn't fully compensate for the low schema coverage, leaving gaps in understanding how to invoke it effectively.

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

Parameters3/5

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

With 0% schema description coverage, the schema provides no parameter details. The description mentions 'mailbox' implicitly but doesn't explain parameters like 'domain' or their purposes. It adds minimal semantic value beyond what's inferred from the tool name.

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 ('List email identities') and target resource ('for mailbox'), with a specific output format ('summary with statistics and samples'). It distinguishes from siblings like 'list_aliases' or 'list_mailboxes' by focusing on identities, but doesn't explicitly contrast them.

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 like 'get_identity' or 'list_aliases', nor any context about prerequisites or exclusions. The description only states what it does, not when it's appropriate.

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/Michaelzag/migadu-mcp'

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