Skip to main content
Glama
adamzaidi

icloud-mcp

by adamzaidi

update_contact

Modify specific details for an existing contact in iCloud Contacts while preserving unchanged information.

Instructions

Update an existing contact in iCloud Contacts. Only provided fields are changed; others are preserved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contactIdYesContact ID to update
firstNameNo
lastNameNo
fullNameNo
orgNo
phoneNo
emailNo
phonesNo
emailsNo
addressesNo
birthdayNo
noteNo
urlNo

Implementation Reference

  • The handler implementation for the `update_contact` tool, which fetches an existing contact, merges new fields, and updates it back to the CardDAV server using a PUT request with ETag validation.
    export async function updateContact(contactId, fields) {
      const { dataHost, addressBookPath } = await discover();
      const url = `${dataHost}${addressBookPath}${contactId}.vcf`;
    
      // Fetch existing to get etag and merge fields
      const existing = await davRequest('GET', url);
      if (existing.status === 404) throw new Error(`Contact not found: ${contactId}`);
    
      const current = parseVCard(existing.body);
    
      // Merge: new fields override, but keep arrays from existing if not overridden
      const merged = { ...current, ...fields };
      // Preserve the original VCARD UID (which may differ from the filename UUID)
      const vcard = serializeVCard(merged, current.uid || contactId);
    
      const resp = await davRequest('PUT', url, {
        contentType: 'text/vcard; charset=utf-8',
        etag: existing.etag,
        body: vcard,
      });
    
      if (resp.status !== 204 && resp.status !== 200) {
        throw new Error(`CardDAV PUT (update) failed: ${resp.status} — ${resp.body.slice(0, 200)}`);
      }
    
      return { updated: true, contactId, etag: resp.etag };
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It successfully discloses the partial-update behavior (preservation of unspecified fields), but omits other critical behavioral traits like error handling for invalid contactIds, authentication requirements, or the return value structure.

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 consists of two efficient sentences with zero waste. The first establishes purpose immediately; the second provides essential behavioral context (partial update semantics). Every word earns its place.

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?

Given the high parameter count (13) and lack of output schema, the description provides the minimum viable context for a standard CRUD operation. However, with severely incomplete schema documentation and no annotations, it should ideally elaborate on parameter expectations or error states to be truly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is critically low at 8% (only contactId is documented). The description fails to compensate by explaining the remaining 12 parameters, their formats (e.g., phone vs phones arrays), or valid value ranges. It mentions 'fields' abstractly without mapping to specific parameters.

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 specific action (Update), resource (contact), and system (iCloud Contacts). It effectively distinguishes from siblings like create_contact, delete_contact, and get_contact through the verb 'Update' and context 'existing contact'.

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 implies PATCH semantics through 'Only provided fields are changed; others are preserved,' guiding the user toward partial updates. However, it lacks explicit guidance on when to use this versus create_contact, or prerequisites like obtaining the contactId first.

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

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