Skip to main content
Glama
MadLlama25

Fastmail MCP Server

by MadLlama25

get_contact

Retrieve a contact by its unique ID to access full contact details, enabling efficient lookups of contact information.

Instructions

Get a specific contact by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contactIdYesID of the contact to retrieve

Implementation Reference

  • Handler for the 'get_contact' tool - extracts contactId from args, initializes the ContactsCalendarClient, and calls getContactById(). Returns the contact as formatted 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),
          },
        ],
      };
    }
  • Input schema registration for the 'get_contact' tool - requires a contactId string parameter.
    {
      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'],
      },
    },
  • src/index.ts:450-463 (registration)
    Tool registration in the ListToolsRequestSchema handler - defines name 'get_contact', description, and inputSchema.
    {
      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 actual implementation: getContactById() in ContactsCalendarClient - checks permissions, builds a JMAP ContactCard/get request with the given id, and returns the contact.
    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 provided, and description only states the action without behavioral context (e.g., read-only, error conditions, permissions). Minimal disclosure beyond the obvious.

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?

Extremely concise single sentence, front-loaded with the action and resource, no wasted words.

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?

Adequate for a simple get-by-ID operation with schema fully covering parameters; no output schema needed but could mention typical response or errors for 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% with one parameter described; description adds no extra meaning beyond what the schema already provides.

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?

Description clearly states verb 'get' and resource 'specific contact by ID', distinguishing it from sibling tools like list_contacts (list all) and search_contacts (search).

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?

No explicit guidance on when to use this tool versus alternatives like search_contacts or list_contacts; usage is implied but not clarified.

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