Skip to main content
Glama
owen-nash

Fastmail MCP Server

by owen-nash

get_contact

Retrieve a specific contact from Fastmail by providing its unique ID.

Instructions

Get a specific contact by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contactIdYesID of the contact to retrieve

Implementation Reference

  • src/index.ts:453-466 (registration)
    Tool 'get_contact' is registered in the ListToolsRequestSchema handler with its name, description, and inputSchema (requires contactId).
    {
      name: 'get_contact',
      description: 'Get a specific contact by ID',
      inputSchema: {
        type: 'object',
        properties: {
          contactId: {
            type: 'string',
            description: 'ID of the contact to retrieve',
          },
        },
        required: ['contactId'],
      },
    },
  • The CallToolRequestSchema handler for case 'get_contact' extracts contactId, initializes the ContactsCalendarClient, and calls getContactById(contactId), returning the contact as JSON.
    case 'get_contact': {
      const { contactId } = args as any;
      if (!contactId) {
        throw new McpError(ErrorCode.InvalidParams, 'contactId is required');
      }
      const contactsClient = initializeContactsCalendarClient();
      const contact = await contactsClient.getContactById(contactId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(contact, null, 2),
          },
        ],
      };
    }
  • The getContactById method on ContactsCalendarClient checks contacts permission, builds a JMAP ContactCard/get request with the given ID, and returns the parsed contact result.
    async getContactById(id: string): Promise<any> {
      // Check permissions first
      const hasPermission = await this.checkContactsPermission();
      if (!hasPermission) {
        throw new Error('Contacts access not available. This account may not have JMAP contacts permissions enabled. Please check your Fastmail account settings or contact support to enable contacts API access.');
      }
    
      const session = await this.getSession();
      
      const request: JmapRequest = {
        using: ['urn:ietf:params:jmap:core', 'urn:ietf:params:jmap:contacts'],
        methodCalls: [
          ['ContactCard/get', {
            accountId: session.accountId,
            ids: [id]
          }, 'contact']
        ]
      };
    
      try {
        const response = await this.makeRequest(request);
        return this.getListResult(response, 0)[0];
      } catch (error) {
        throw new Error(`Contact access not supported: ${error instanceof Error ? error.message : String(error)}. Try checking account permissions or enabling contacts API access in Fastmail settings.`);
      }
    }
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits like required permissions, rate limits, or error behavior. For a simple read operation, the lack of transparency is a 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, clear sentence with no unnecessary words. It is optimally concise and front-loaded.

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 provides sufficient information to understand its purpose. However, adding what is returned (e.g., contact details) 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?

The schema covers both parameters with descriptions. The tool description adds no additional meaning beyond 'by ID', which is already implied. With 100% schema coverage, the baseline score of 3 is appropriate.

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 contact by ID' clearly specifies the action (get), resource (contact), and method (by ID). It distinguishes from siblings like list_contacts and search_contacts.

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?

The description provides no guidance on when to use this tool versus alternatives, such as list_contacts or search_contacts. It lacks explicit usage context 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