Skip to main content
Glama
MadLlama25

Fastmail MCP Server

by MadLlama25

bulk_pin

Pin or unpin multiple emails at once in Fastmail by providing an array of email IDs and a pinned flag. Simplify inbox organization by applying pin status to many messages simultaneously.

Instructions

Pin or unpin multiple emails

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailIdsYesArray of email IDs to pin/unpin
pinnedNotrue to pin, false to unpin

Implementation Reference

  • Schema/registration for the 'bulk_pin' tool: defines input schema with emailIds array and pinned boolean.
      name: 'bulk_pin',
      description: 'Pin or unpin multiple emails',
      inputSchema: {
        type: 'object',
        properties: {
          emailIds: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of email IDs to pin/unpin',
          },
          pinned: {
            type: 'boolean',
            description: 'true to pin, false to unpin',
            default: true,
          },
        },
        required: ['emailIds'],
      },
    },
  • src/index.ts:864-883 (registration)
    Tool registration in ListToolsRequestSchema: declares the 'bulk_pin' tool name, description, and inputSchema.
    {
      name: 'bulk_pin',
      description: 'Pin or unpin multiple emails',
      inputSchema: {
        type: 'object',
        properties: {
          emailIds: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of email IDs to pin/unpin',
          },
          pinned: {
            type: 'boolean',
            description: 'true to pin, false to unpin',
            default: true,
          },
        },
        required: ['emailIds'],
      },
    },
  • Handler for 'bulk_pin' in CallToolRequestSchema switch statement: validates emailIds, calls client.bulkPinEmails(), returns success message.
    case 'bulk_pin': {
      const { emailIds, pinned = true } = args as any;
      if (!emailIds || !Array.isArray(emailIds) || emailIds.length === 0) {
        throw new McpError(ErrorCode.InvalidParams, 'emailIds array is required and must not be empty');
      }
      const client = initializeClient();
      await client.bulkPinEmails(emailIds, pinned);
      return {
        content: [
          {
            type: 'text',
            text: `${emailIds.length} emails ${pinned ? 'pinned' : 'unpinned'} successfully`,
          },
        ],
      };
    }
  • Actual implementation of bulkPinEmails() in JmapClient: builds Email/set update with $flagged keyword for each emailId, sends JMAP request.
    async bulkPinEmails(emailIds: string[], pinned: boolean = true): Promise<void> {
      const session = await this.getSession();
    
      const updates: Record<string, any> = {};
      emailIds.forEach(id => {
        updates[id] = pinned
          ? { 'keywords/$flagged': true }
          : { 'keywords/$flagged': null };
      });
    
      const request: JmapRequest = {
        using: ['urn:ietf:params:jmap:core', 'urn:ietf:params:jmap:mail'],
        methodCalls: [
          ['Email/set', {
            accountId: session.accountId,
            update: updates
          }, 'bulkFlag']
        ]
      };
    
      const response = await this.makeRequest(request);
      const result = this.getMethodResult(response, 0);
    
      if (result.notUpdated && Object.keys(result.notUpdated).length > 0) {
        throw new Error('Failed to pin/unpin some emails.');
      }
    }
Behavior2/5

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

No annotations provided; description only states the action without detailing side effects, error handling, or permissions for bulk operations.

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

Conciseness4/5

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

Single sentence is concise and front-loaded, but could include more useful information without verbosity.

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?

Schema covers parameters, but no output schema or return value explanation; minimal context for a bulk operation.

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% with descriptions for both parameters; description adds no extra meaning beyond schema.

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 action (pin/unpin) and resource (multiple emails), distinguishing it from the singular pin_email tool.

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 on when to use this tool versus alternatives like pin_email or other bulk operations. Missing context for appropriate use.

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