Skip to main content
Glama
4tal

MCP Google Contacts Server

by 4tal

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

Implementation Reference

  • MCP tool handler for 'get_other_contacts'. Decorated with @mcp.tool() for automatic registration. Fetches other contacts via GoogleContactsService and formats the response as a string.
    @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)}"
  • src/tools.py:383-383 (registration)
    The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool()
  • Core implementation in GoogleContactsService class that queries the Google People API for 'Other Contacts' and formats them into a list of dicts.
    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
  • Function signature defines the input schema (max_results: int = 50) and output type (str).
    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)
        """
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 only states it's a retrieval operation. It doesn't disclose behavioral traits like whether this requires authentication, rate limits, pagination behavior, error conditions, or what format the results return. The description is minimal 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 plus a parameter section. The first sentence states the purpose, followed by explanatory context, and then parameter details. It's front-loaded and efficient, though the parameter section could be integrated more smoothly.

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 no annotations, no output schema, and low schema coverage, the description is incomplete. It covers the purpose and one parameter but lacks details on authentication, rate limits, result format, pagination, or error handling. For a retrieval tool with siblings, more context is needed to be fully helpful.

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 adds the parameter 'max_results' with a default value and brief explanation, which is valuable since schema description coverage is 0% (the schema only provides title and type). However, it doesn't detail constraints like valid ranges or effects beyond 'maximum number of results to return'.

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 a helpful explanation of what 'Other contacts' means. It distinguishes this from main contacts but doesn't explicitly differentiate from sibling tools like 'list_contacts' or 'search_contacts'.

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 what 'Other contacts' are (people interacted with but not in contacts list), suggesting when this tool is appropriate. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'list_contacts' or 'search_contacts', nor does it mention 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