Skip to main content
Glama

update_contact

Modify contact details in Keila newsletter system by updating email, first name, or last name for existing contacts.

Instructions

Update an existing contact.

Args: contact_id: The contact ID (e.g. "c_12345"). email: New email address (optional). first_name: New first name (optional). last_name: New last name (optional).

Returns: The updated contact record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contact_idYes
emailNo
first_nameNo
last_nameNo

Implementation Reference

  • mcp_server.py:64-79 (registration)
    Registration of the "update_contact" MCP tool.
    @mcp.tool()
    def update_contact(contact_id: str, email: str | None = None, first_name: str | None = None,
                       last_name: str | None = None) -> dict:
        """
        Update an existing contact.
    
        Args:
            contact_id: The contact ID (e.g. "c_12345").
            email: New email address (optional).
            first_name: New first name (optional).
            last_name: New last name (optional).
    
        Returns:
            The updated contact record.
        """
        return _client.update_contact(contact_id, email=email, first_name=first_name, last_name=last_name)
  • client.py:74-92 (handler)
    The actual Keila API client implementation for updating a contact.
    def update_contact(self, contact_id: str, email: str | None = None, first_name: str | None = None,
                       last_name: str | None = None, data: dict | None = None, id_type: str | None = None) -> dict:
        """Update an existing contact."""
        contact_data = {}
        if email:
            contact_data["email"] = email
        if first_name is not None:
            contact_data["first_name"] = first_name
        if last_name is not None:
            contact_data["last_name"] = last_name
        if data:
            contact_data["data"] = data
        params = {}
        if id_type:
            params["id_type"] = id_type
        resp = self.session.patch(f"{self.url}/api/v1/contacts/{contact_id}", json={"data": contact_data},
                                 params=params, headers=self._headers(), timeout=30)
        resp.raise_for_status()
        return resp.json()

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/gwbischof/keila-mcp'

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