Skip to main content
Glama
4tal

MCP Google Contacts Server

by 4tal

list_contact_groups

Retrieve all contact groups (labels) from Google Contacts to organize contacts into categories like Family, Work, or Friends. Optionally include system groups such as My Contacts.

Instructions

List all contact groups (labels) in your Google Contacts.

    Contact groups are like labels that help you organize your contacts into categories
    such as 'Family', 'Work', 'Friends', etc.

    Args:
        include_system_groups: Whether to include system groups like "My Contacts", "Starred", etc.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_system_groupsNo

Implementation Reference

  • MCP tool handler: async function decorated with @mcp.tool() that initializes the service, calls service.list_contact_groups(), formats the result, and handles errors.
    @mcp.tool()
    async def list_contact_groups(include_system_groups: bool = True) -> str:
        """List all contact groups (labels) in your Google Contacts.
    
        Contact groups are like labels that help you organize your contacts into categories
        such as 'Family', 'Work', 'Friends', etc.
    
        Args:
            include_system_groups: Whether to include system groups like "My Contacts", "Starred", etc.
        """
        service = init_service()
        if not service:
            return "Error: Google Contacts service is not available. Please check your credentials."
    
        try:
            groups = service.list_contact_groups(include_system_groups)
            return format_contact_groups_list(groups)
        except Exception as e:
            return f"Error: Failed to list contact groups - {str(e)}"
  • src/tools.py:72-72 (registration)
    Call to register_contact_group_tools(mcp) within register_tools, which defines and registers the tool via nested @mcp.tool() decorators.
    register_contact_group_tools(mcp)
  • Core service method in GoogleContactsService class that calls the Google Contacts API to list groups, filters system groups if requested, formats them, and returns the list.
    def list_contact_groups(self, include_system_groups: bool = True) -> List[Dict[str, Any]]:
        """List all contact groups owned by the authenticated user.
    
        Args:
            include_system_groups: Whether to include system contact groups
    
        Returns:
            List of contact group dictionaries
        """
        try:
            response = self.service.contactGroups().list().execute()
            contact_groups = response.get("contactGroups", [])
    
            if not include_system_groups:
                contact_groups = [
                    group
                    for group in contact_groups
                    if group.get("groupType") == "USER_CONTACT_GROUP"
                ]
    
            formatted_groups = []
            for group in contact_groups:
                formatted_group = self._format_contact_group(group)
                formatted_groups.append(formatted_group)
    
            return formatted_groups
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose whether this is a read-only operation, if it requires specific permissions, what the return format looks like (e.g., list structure, pagination), or any rate limits. The explanation of contact groups is helpful context but insufficient for a mutation-free tool.

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?

Well-structured with a clear purpose statement, explanatory context about contact groups, and parameter documentation in a dedicated Args section. The sentences earn their place, though the contact group explanation could be slightly more concise for a purely functional description.

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

Completeness3/5

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

For a simple list tool with one parameter and no output schema, the description covers the basics but has gaps. It explains what contact groups are and documents the parameter, but lacks behavioral context (especially important with no annotations) and doesn't describe the return value format, which would be helpful since there's no output schema.

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?

The description explicitly documents the single parameter 'include_system_groups' with a clear explanation of what it does, compensating for the 0% schema description coverage. Since there's only one parameter and it's fully explained in the description, this meets the baseline expectation for minimal parameter documentation.

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 ('List') and resource ('all contact groups (labels) in your Google Contacts'), with a helpful explanation of what contact groups are. It distinguishes from siblings like 'get_contact_group' (singular) by emphasizing 'all', but doesn't explicitly differentiate from other list/search tools like 'list_contacts' or 'search_contacts_by_group'.

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 explicit guidance on when to use this tool versus alternatives like 'list_contacts', 'search_contacts_by_group', or 'get_contact_group'. The description implies it's for retrieving groups rather than contacts, but doesn't specify use cases, prerequisites, or exclusions.

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