Skip to main content
Glama
owen-nash

Fastmail MCP Server

by owen-nash

get_email

Retrieve the full details of an email using its unique identifier.

Instructions

Get a specific email by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailIdYesID of the email to retrieve

Implementation Reference

  • src/index.ts:167-180 (registration)
    Tool registration for 'get_email' in the ListToolsRequestSchema handler, defining name, description, and input schema requiring emailId.
    {
      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'],
      },
    },
  • Input schema for get_email: requires 'emailId' string property.
    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'],
    },
  • MCP tool handler for 'get_email'. Extracts emailId from args, validates it's present, calls client.getEmailById(emailId), and returns the result as JSON text.
    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 on JmapClient. Sends a JMAP Email/get request with the given ID and requested properties (subject, from, to, cc, textBody, htmlBody, attachments, etc.), then returns the email object. Throws if not found.
    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?

The description lacks any behavioral details beyond the parameter. It does not disclose what data the response contains, any permission requirements, or whether the email is returned in full. Since no annotations are provided, the description carries the full burden, and it falls short.

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

Conciseness3/5

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

The description is very concise (five words) but lacks necessary context. It is front-loaded, but the brevity reduces its informative value. Every word earns its place, but more details could be added without being verbose.

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 absence of an output schema, the description should explain what is returned (e.g., email details or attachments). It does not. For a simple tool, this is still incomplete for an AI to understand the tool's full behavior.

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?

The parameter 'emailId' is described in the schema as 'ID of the email to retrieve', which is clear. The tool description adds no additional semantic meaning beyond what the schema already provides. With 100% schema coverage, the baseline is 3.

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 clearly states 'Get a specific email by ID', which is a specific verb-resource combination. It distinguishes from sibling tools like 'get_recent_emails' or 'search_emails' by focusing on a single email retrieval by ID.

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. For example, it doesn't mention that this is for retrieving a known email by ID, as opposed to listing or searching. There are no prerequisites or exclusion criteria.

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

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