Skip to main content
Glama
MadLlama25

Fastmail MCP Server

by MadLlama25

get_email

Retrieve a specific email from Fastmail using its ID. Access the full email content including headers, body, and attachments for review or processing.

Instructions

Get a specific email by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailIdYesID of the email to retrieve

Implementation Reference

  • src/index.ts:164-177 (registration)
    Tool 'get_email' is registered in the ListToolsRequestSchema handler with its name, description, and inputSchema requiring an emailId string parameter.
    {
      name: 'get_email',
      description: 'Get a specific email by ID',
      inputSchema: {
        type: 'object',
        properties: {
          emailId: {
            type: 'string',
            description: 'ID of the email to retrieve',
          },
        },
        required: ['emailId'],
      },
    },
  • The CallToolRequestSchema handler for 'get_email' extracts the emailId from args, validates it, and calls client.getEmailById(emailId).
    case 'get_email': {
      const { emailId } = args as any;
      if (!emailId) {
        throw new McpError(ErrorCode.InvalidParams, 'emailId is required');
      }
      const email = await client.getEmailById(emailId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(email, null, 2),
          },
        ],
      };
    }
  • The getEmailById method in JmapClient executes the actual JMAP Email/get request to fetch a single email by ID, requesting properties like subject, from, to, textBody, htmlBody, attachments, etc.
    async getEmailById(id: string): Promise<any> {
      const session = await this.getSession();
      
      const request: JmapRequest = {
        using: ['urn:ietf:params:jmap:core', 'urn:ietf:params:jmap:mail'],
        methodCalls: [
          ['Email/get', {
            accountId: session.accountId,
            ids: [id],
            properties: ['id', 'subject', 'from', 'to', 'cc', 'bcc', 'replyTo', 'receivedAt', 'textBody', 'htmlBody', 'attachments', 'bodyValues', 'messageId', 'threadId', 'inReplyTo', 'references', 'keywords', 'header:List-Unsubscribe:asURLs'],
            bodyProperties: ['partId', 'blobId', 'type', 'size'],
            fetchTextBodyValues: true,
            fetchHTMLBodyValues: true,
          }, 'email']
        ]
      };
    
      const response = await this.makeRequest(request);
      const result = this.getMethodResult(response, 0);
    
      if (result.notFound && result.notFound.includes(id)) {
        throw new Error(`Email with ID '${id}' not found`);
      }
    
      const email = result.list?.[0];
      if (!email) {
        throw new Error(`Email with ID '${id}' not found or not accessible`);
      }
      
      return email;
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states a basic action. It fails to disclose behavioral traits such as retrieval scope (e.g., full email vs. headers), permissions, or side effects.

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, concise sentence front-loaded with the action. Every word is necessary, and there is no wasted text.

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?

For a simple retrieval tool with one parameter and no output schema, the description is adequate but lacks details about the return structure (e.g., what fields are included) which would enhance completeness.

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?

Schema coverage is 100%, so the schema already defines the emailId parameter. The description adds no extra meaning beyond what the schema provides, meeting the baseline.

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

Purpose5/5

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

The description 'Get a specific email by ID' clearly states the verb (Get), resource (email), and identifier (ID), distinguishing it from sibling tools like list_emails or get_thread.

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_recent_emails or get_thread. The description is too brief to offer usage context.

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/MadLlama25/fastmail-mcp'

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