Skip to main content
Glama
RayanZaki

MCP Google Contacts Server

by RayanZaki

create_contact

Add new contacts to Google Contacts by providing first name, last name, email, and phone number details.

Instructions

Create a new contact.

    Args:
        given_name: First name of the contact
        family_name: Last name of the contact
        email: Email address of the contact
        phone: Phone number of the contact
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
given_nameYes
family_nameNo
emailNo
phoneNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main MCP tool handler for 'create_contact', registered via @mcp.tool() decorator. Handles input parameters, initializes service, calls the service helper, and formats response.
    @mcp.tool()
    async def create_contact(given_name: str, family_name: Optional[str] = None, 
                           email: Optional[str] = None, phone: Optional[str] = None) -> str:
        """Create a new contact.
        
        Args:
            given_name: First name of the contact
            family_name: Last name of the contact
            email: Email address of the contact
            phone: Phone number of the contact
        """
        service = init_service()
        if not service:
            return "Error: Google Contacts service is not available. Please check your credentials."
        
        try:
            contact = service.create_contact(
                given_name, 
                family_name, 
                email, 
                phone
            )
            return f"Contact created successfully!\n\n{format_contact(contact)}"
        except Exception as e:
            return f"Error: Failed to create contact - {str(e)}"
  • Core helper method in GoogleContactsService that constructs the contact body and executes the Google People API createContact call.
    def create_contact(self, given_name: str, family_name: Optional[str] = None, 
                       email: Optional[str] = None, phone: Optional[str] = None) -> Dict:
        """Create a new contact."""
        try:
            contact_body = {
                'names': [
                    {
                        'givenName': given_name,
                        'familyName': family_name or ''
                    }
                ]
            }
            
            if email:
                contact_body['emailAddresses'] = [{'value': email}]
            
            if phone:
                contact_body['phoneNumbers'] = [{'value': phone}]
            
            person = self.service.people().createContact(
                body=contact_body
            ).execute()
            
            return self._format_contact(person)
        
        except HttpError as error:
            raise GoogleContactsError(f"Error creating contact: {error}")
  • Invocation of register_tools(mcp) which defines and registers all tools including create_contact via nested @mcp.tool() decorators.
    register_tools(mcp)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Create' implies a write operation, the description doesn't address permissions needed, whether duplicates are allowed, what happens on failure, or what the output contains. This leaves significant behavioral questions unanswered.

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 concise with a clear purpose statement followed by parameter documentation. The Args section is well-structured and easy to parse. Minor formatting issues with indentation slightly detract from perfect structure.

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 this is a write operation with no annotations and 4 parameters, the description provides adequate parameter semantics but lacks behavioral context. The presence of an output schema means the description doesn't need to explain return values, but it should address more about the creation operation's behavior and constraints.

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 provides clear parameter documentation in the Args section, explaining what each parameter represents. With 0% schema description coverage, this documentation fully compensates by adding essential semantic meaning beyond the bare schema. Only minor formatting issues prevent a perfect score.

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 ('Create') and resource ('contact'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'update_contact' or specify what makes this creation operation unique versus alternatives.

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?

The description provides no guidance on when to use this tool versus alternatives like 'update_contact' or 'search_contacts'. There's no mention of prerequisites, constraints, or typical use cases for creating versus other contact operations.

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