Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

create_contact

Add new contacts to iCloud Contacts with details like name, phone, email, address, and organization. Manage contact information through structured input for personal or professional use.

Instructions

Create a new contact in iCloud Contacts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
firstNameNoFirst name
lastNameNoLast name
fullNameNoFull display name (overrides firstName + lastName for FN field)
orgNoOrganization / company name
phoneNoPrimary phone number (shorthand for phones array)
emailNoPrimary email address (shorthand for emails array)
phonesNoArray of phone objects: [{ number, type }] where type is cell/home/work/etc.
emailsNoArray of email objects: [{ email, type }] where type is home/work/etc.
addressesNoArray of address objects: [{ street, city, state, zip, country, type }]
birthdayNoBirthday in YYYY-MM-DD format
noteNoNotes / free text
urlNoWebsite URL

Implementation Reference

  • The 'createContact' function in 'lib/carddav.js' implements the creation logic by generating a VCard, assigning a new UUID, and performing a PUT request to the iCloud CardDAV server.
    export async function createContact(fields) {
      const { dataHost, addressBookPath } = await discover();
      const contactId = randomUUID().toUpperCase();
      const vcard = serializeVCard({ ...fields }, contactId);
      const url = `${dataHost}${addressBookPath}${contactId}.vcf`;
    
      const resp = await davRequest('PUT', url, {
        contentType: 'text/vcard; charset=utf-8',
        body: vcard,
      });
    
      if (resp.status !== 201 && resp.status !== 204 && resp.status !== 200) {
        throw new Error(`CardDAV PUT failed: ${resp.status} — ${resp.body.slice(0, 200)}`);
      }
    
      return { created: true, contactId, etag: resp.etag };
    }

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/adamzaidi/icloud-mcp'

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