Skip to main content
Glama
4tal

MCP Google Contacts Server

by 4tal

update_contact_group

Modify the name and custom data of an existing contact group in Google Contacts. Use this tool to rename groups or update associated metadata for better organization.

Instructions

Update a contact group's name and custom data.

    Args:
        resource_name: Contact group resource name (e.g., "contactGroups/12345")
        name: New name for the contact group
        client_data: Optional updated custom data as list of key-value pairs
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resource_nameYes
nameYes
client_dataNo

Implementation Reference

  • MCP tool handler: async function decorated with @mcp.tool() that initializes the service, calls service.update_contact_group, formats the result, and handles errors.
    @mcp.tool()
    async def update_contact_group(
        resource_name: str, name: str, client_data: List[Dict[str, str]] = None
    ) -> str:
        """Update a contact group's name and custom data.
    
        Args:
            resource_name: Contact group resource name (e.g., "contactGroups/12345")
            name: New name for the contact group
            client_data: Optional updated custom data as list of key-value pairs
        """
        service = init_service()
        if not service:
            return "Error: Google Contacts service is not available. Please check your credentials."
    
        try:
            group = service.update_contact_group(resource_name, name, client_data)
            return f"Contact group updated successfully!\n\n{format_contact_group(group)}"
        except Exception as e:
            return f"Error: Failed to update contact group - {str(e)}"
  • Service helper method in GoogleContactsService that performs the Google People API call to update the contact group, handling ETag for concurrency and formatting the response.
    def update_contact_group(
        self, resource_name: str, name: str, client_data: Optional[List[Dict[str, str]]] = None
    ) -> Dict[str, Any]:
        """Update a contact group's name and client data.
    
        Args:
            resource_name: Contact group resource name
            name: New name for the contact group
            client_data: Optional updated client data
    
        Returns:
            Updated contact group dictionary
        """
        try:
            # Get current group for etag
            current_group = self.service.contactGroups().get(resourceName=resource_name).execute()
    
            contact_group_body = {
                "contactGroup": {
                    "resourceName": resource_name,
                    "etag": current_group.get("etag"),
                    "name": name,
                },
                "updateGroupFields": "name",
            }
    
            if client_data:
                contact_group_body["contactGroup"]["clientData"] = client_data
                contact_group_body["updateGroupFields"] = "name,clientData"
    
            response = (
                self.service.contactGroups()
                .update(contactGroup_resourceName=resource_name, body=contact_group_body)
                .execute()
            )
    
            return self._format_contact_group(response)
    
        except HttpError as error:
            raise GoogleContactsError(f"Error updating contact group: {error}")
  • src/main.py:71-74 (registration)
    Registration point where the MCP server is created and register_tools(mcp) is called, which in turn calls register_contact_group_tools(mcp) to define/register the update_contact_group tool via decorator.
    mcp = FastMCP("google-contacts")
    
    # Register all tools
    register_tools(mcp)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It discloses the update action but lacks critical behavioral details: permission requirements, whether changes are reversible, rate limits, error conditions, or what happens to unspecified fields. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose, followed by parameter details in a structured Args section. No wasted sentences, though the parameter explanations could be slightly more concise. Overall efficient and well-organized for its length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It covers parameters adequately but misses behavioral context (e.g., side effects, permissions, response format). Given the complexity and lack of structured data, it should provide more operational guidance.

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

Parameters4/5

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

Schema description coverage is 0%, but the description compensates well by explaining all 3 parameters: 'resource_name' (with example), 'name' (new name), and 'client_data' (optional custom data as key-value pairs). It adds meaning beyond the bare schema, clarifying purpose and format, though it doesn't detail constraints like string length or key formats.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'update' and resource 'contact group' with specific fields 'name and custom data'. It distinguishes from siblings like 'create_contact_group' (creation) and 'delete_contact_group' (deletion), though not explicitly. However, it doesn't fully differentiate from 'update_contact' or 'update_contact_advanced' which target different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., existing contact group), exclusions, or comparisons to siblings like 'update_contact' (for individual contacts) or 'update_contact_advanced' (for more complex updates). The description only states what it does, not when to choose it.

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/4tal/mcp-google-contacts'

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