Skip to main content
Glama
RayanZaki

MCP Google Contacts Server

by RayanZaki

get_other_contacts

Retrieve contacts from Google's 'Other contacts' section to access people you've interacted with but haven't added to your main contacts list, such as email correspondents.

Instructions

Retrieve contacts from the 'Other contacts' section.

    Other contacts are people you've interacted with but haven't added to your contacts list.
    These often include email correspondents that aren't in your main contacts.
    
    Args:
        max_results: Maximum number of results to return (default: 50)
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main MCP tool handler function for 'get_other_contacts'. It initializes the GoogleContactsService, calls the service method, formats the results using format_contacts_list, counts contacts with emails, and returns a formatted string response.
    @mcp.tool()
    async def get_other_contacts(max_results: int = 50) -> str:
        """Retrieve contacts from the 'Other contacts' section.
        
        Other contacts are people you've interacted with but haven't added to your contacts list.
        These often include email correspondents that aren't in your main contacts.
        
        Args:
            max_results: Maximum number of results to return (default: 50)
        """
        service = init_service()
        if not service:
            return "Error: Google Contacts service is not available. Please check your credentials."
        
        try:
            other_contacts = service.get_other_contacts(max_results)
            
            if not other_contacts:
                return "No 'Other contacts' found in your Google account."
            
            # Count how many have email addresses
            with_email = sum(1 for c in other_contacts if c.get('email'))
            
            # Format and return the results
            formatted_list = format_contacts_list(other_contacts)
            return f"Other Contacts (people you've interacted with but haven't added):\n\n{formatted_list}\n\n{with_email} of these contacts have email addresses."
        except Exception as e:
            return f"Error: Failed to retrieve other contacts - {str(e)}"
  • The call to register_tools(mcp) in the main server function, which registers all tools including 'get_other_contacts' via the @mcp.tool() decorators defined in tools.py.
    register_tools(mcp)
  • The GoogleContactsService.get_other_contacts method that implements the core logic by calling the Google People API otherContacts().list() endpoint, formats the results, and returns a list of contact dictionaries.
    def get_other_contacts(self, max_results: int = 100) -> List[Dict]:
        """Get contacts from the 'Other contacts' section of Google Contacts.
        
        These are contacts that the user has interacted with but has not added to their contacts.
        
        Args:
            max_results: Maximum number of results to return
            
        Returns:
            List of other contact dictionaries
        """
        try:
            response = self.service.otherContacts().list(
                readMask='names,emailAddresses,phoneNumbers',
                pageSize=max_results
            ).execute()
            
            other_contacts = response.get('otherContacts', [])
            
            if not other_contacts:
                return []
            
            # Format the results
            contacts = []
            for person in other_contacts:
                contact = self._format_contact(person)
                contacts.append(contact)
            
            return contacts
            
        except HttpError as error:
            raise Exception(f"Error getting other contacts: {error}")
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states this is a retrieval operation, implying read-only behavior, but doesn't disclose other behavioral traits such as authentication requirements, rate limits, pagination, error handling, or what the output contains. The description adds minimal context beyond the basic purpose.

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?

The description is appropriately sized with three sentences: the first states the purpose, the second explains 'Other contacts', and the third documents the parameter. It's front-loaded with the main action, and each sentence adds value without redundancy. Minor improvements could include more structured formatting.

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?

Given the tool has one parameter and an output schema exists, the description covers the basics but lacks depth. It explains what 'Other contacts' are and documents the parameter, but without annotations, it misses behavioral context like safety or performance traits. The output schema likely handles return values, so completeness is adequate but not thorough.

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?

With 0% schema description coverage, the description compensates by documenting the single parameter 'max_results' with its default value and purpose. This adds meaningful semantics beyond the schema, which only provides the title and type. However, it doesn't specify constraints like minimum/maximum values or format details.

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 'retrieve' and the resource 'contacts from the Other contacts section', with additional context explaining what 'Other contacts' are. However, it doesn't explicitly differentiate from sibling tools like list_contacts or search_contacts, which likely retrieve different contact sets.

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

Usage Guidelines3/5

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

The description implies usage by explaining that 'Other contacts' are people interacted with but not in the main contacts list, suggesting this tool is for retrieving that specific subset. However, it doesn't provide explicit guidance on when to use this versus alternatives like list_contacts or search_contacts, nor does it mention any 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/RayanZaki/mcp-google-contacts-server'

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