update_contact_advanced
Update existing Google Contacts with comprehensive field support including multiple emails, phone numbers, addresses, and other contact details.
Instructions
Update an existing contact with full field support including multiple emails, phones, addresses, etc.
Args:
resource_name: Contact resource name (people/*)
contact_data: Dictionary containing updated contact information with full field support
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resource_name | Yes | ||
| contact_data | Yes |
Implementation Reference
- src/tools.py:300-317 (handler)The core handler function for the 'update_contact_advanced' tool. Decorated with @mcp.tool() for registration. Initializes the Google Contacts service, calls service.update_contact with the provided parameters, formats the result, and handles errors.@mcp.tool() async def update_contact_advanced(resource_name: str, contact_data: Dict[str, Any]) -> str: """Update an existing contact with full field support including multiple emails, phones, addresses, etc. Args: resource_name: Contact resource name (people/*) contact_data: Dictionary containing updated contact information with full field support """ service = init_service() if not service: return "Error: Google Contacts service is not available. Please check your credentials." try: contact = service.update_contact(resource_name, contact_data) return f"Advanced contact updated successfully!\n\n{format_contact(contact)}" except Exception as e: return f"Error: Failed to update advanced contact - {str(e)}"
- src/tools.py:64-73 (registration)Top-level registration function that invokes register_contact_tools (where update_contact_advanced is defined and registered via nested @mcp.tool()).def register_tools(mcp: FastMCP) -> None: """Register all Google Contacts tools with the MCP server. Args: mcp: FastMCP server instance """ register_contact_tools(mcp) register_directory_tools(mcp) register_contact_group_tools(mcp)
- src/main.py:74-75 (registration)In main.py, register_tools is called on the FastMCP instance to register all tools, including 'update_contact_advanced'.register_tools(mcp)