get_contact
Retrieve a specific contact's details from the Keila newsletter platform by providing their unique contact ID.
Instructions
Fetch a single contact by ID.
Args: contact_id: The contact ID (e.g. "c_12345").
Returns: A dict with contact details: id, email, first_name, last_name, status, data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contact_id | Yes |
Implementation Reference
- mcp_server.py:34-45 (handler)The MCP tool handler function 'get_contact' registered with @mcp.tool() which calls the underlying KeilaClient.get_contact method.
@mcp.tool() def get_contact(contact_id: str) -> dict: """ Fetch a single contact by ID. Args: contact_id: The contact ID (e.g. "c_12345"). Returns: A dict with contact details: id, email, first_name, last_name, status, data. """ return _client.get_contact(contact_id) - client.py:49-56 (handler)The implementation logic of the KeilaClient.get_contact method which performs the HTTP GET request to the Keila API.
def get_contact(self, contact_id: str, id_type: str | None = None) -> dict: """Fetch a single contact by ID.""" params = {} if id_type: params["id_type"] = id_type resp = self.session.get(f"{self.url}/api/v1/contacts/{contact_id}", params=params, headers=self._headers(), timeout=30) resp.raise_for_status() return resp.json()