Skip to main content
Glama
MadLlama25

Fastmail MCP Server

by MadLlama25

get_email_attachments

Retrieve a list of all attachments associated with an email using its unique ID.

Instructions

Get list of attachments for an email

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailIdYesID of the email

Implementation Reference

  • The handler that executes the 'get_email_attachments' tool logic. Makes a JMAP Email/get call requesting only the 'attachments' property for the given email ID and returns the attachments array.
    async getEmailAttachments(emailId: 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: [emailId],
            properties: ['attachments']
          }, 'getAttachments']
        ]
      };
    
      const response = await this.makeRequest(request);
      const email = this.getListResult(response, 0)[0];
      return email?.attachments || [];
    }
  • src/index.ts:716-728 (registration)
    Tool registration with name, description, and input schema in the ListToolsRequestSchema handler.
      name: 'get_email_attachments',
      description: 'Get list of attachments for an email',
      inputSchema: {
        type: 'object',
        properties: {
          emailId: {
            type: 'string',
            description: 'ID of the email',
          },
        },
        required: ['emailId'],
      },
    },
  • The CallToolRequestSchema case handler that delegates to client.getEmailAttachments() and returns the result.
    case 'get_email_attachments': {
      const { emailId } = args as any;
      if (!emailId) {
        throw new McpError(ErrorCode.InvalidParams, 'emailId is required');
      }
      const client = initializeClient();
      const attachments = await client.getEmailAttachments(emailId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(attachments, null, 2),
          },
        ],
      };
    }
Behavior2/5

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

No annotations are provided, and the description only states the action without disclosing behavioral traits such as return format (metadata vs. content), pagination, authentication requirements, or side effects. For a read-only tool, this lack of transparency is a notable 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, direct sentence with no superfluous words. It efficiently conveys the core purpose without redundancy.

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

Completeness4/5

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

Given the tool's simplicity (one parameter, no output schema), the description is mostly complete. However, it could be improved by specifying what information the list contains (e.g., attachment names, sizes) to reduce ambiguity.

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 input schema already fully describes the one parameter ('emailId') with a clear description. The description does not add additional meaning beyond the schema, so it meets the baseline for 100% schema coverage.

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 the tool retrieves a list of attachments for a given email, using a specific verb and resource. It effectively distinguishes from sibling tools like 'download_attachment' which downloads a specific attachment, and 'get_email' which retrieves the email content itself.

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

Usage Guidelines3/5

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 (e.g., 'download_attachment' for individual attachments). It does not mention prerequisites or contexts where it is appropriate, leaving the agent to infer usage based solely on the purpose.

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