create_contact_advanced
Create detailed Google Contacts entries with multiple emails, phone numbers, addresses, relations, events, and custom fields in a single operation.
Instructions
Create a new contact with full field support including multiple emails, phones, addresses, etc.
Args:
contact_data: Dictionary containing complete contact information with support for:
- Multiple emails: {"emails": [{"value": "email@example.com", "type": "work"}]}
- Multiple phones: {"phones": [{"value": "+1234567890", "type": "mobile"}]}
- Multiple addresses: {"addresses": [{"formatted": "123 Main St", "type": "home"}]}
- Relations: {"relations": [{"person": "John Doe", "type": "spouse"}]}
- Events: {"events": [{"date": {"month": 12, "day": 25}, "type": "anniversary"}]}
- Custom fields: {"custom_fields": [{"key": "Department", "value": "Engineering"}]}
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contact_data | Yes |
Implementation Reference
- src/tools.py:207-229 (handler)The handler function decorated with @mcp.tool(), implementing the core logic for creating advanced contacts by calling the GoogleContactsService.@mcp.tool() async def create_contact_advanced(contact_data: Dict[str, Any]) -> str: """Create a new contact with full field support including multiple emails, phones, addresses, etc. Args: contact_data: Dictionary containing complete contact information with support for: - Multiple emails: {"emails": [{"value": "email@example.com", "type": "work"}]} - Multiple phones: {"phones": [{"value": "+1234567890", "type": "mobile"}]} - Multiple addresses: {"addresses": [{"formatted": "123 Main St", "type": "home"}]} - Relations: {"relations": [{"person": "John Doe", "type": "spouse"}]} - Events: {"events": [{"date": {"month": 12, "day": 25}, "type": "anniversary"}]} - Custom fields: {"custom_fields": [{"key": "Department", "value": "Engineering"}]} """ service = init_service() if not service: return "Error: Google Contacts service is not available. Please check your credentials." try: contact = service.create_contact(contact_data) return f"Advanced contact created successfully!\n\n{format_contact(contact)}" except Exception as e: return f"Error: Failed to create advanced contact - {str(e)}"