Skip to main content
Glama

MCP Google Contacts Server

by RayanZaki

delete_contact

Remove a specific contact from Google Contacts by providing its unique resource name. Facilitates contact management directly within Google Workspace.

Instructions

Delete a contact by resource name.

Args: resource_name: Contact resource name (people/*) to delete

Input Schema

NameRequiredDescriptionDefault
resource_nameYes

Input Schema (JSON Schema)

{ "properties": { "resource_name": { "title": "Resource Name", "type": "string" } }, "required": [ "resource_name" ], "title": "delete_contactArguments", "type": "object" }

Implementation Reference

  • The MCP tool handler for 'delete_contact'. This async function is decorated with @mcp.tool() for registration and handles the tool execution by calling the service method.
    @mcp.tool() async def delete_contact(resource_name: str) -> str: """Delete a contact by resource name. Args: resource_name: Contact resource name (people/*) to delete """ service = init_service() if not service: return "Error: Google Contacts service is not available. Please check your credentials." try: result = service.delete_contact(resource_name) if result.get('success'): return f"Contact {resource_name} deleted successfully." else: return f"Failed to delete contact: {result.get('message', 'Unknown error')}" except Exception as e: return f"Error: Failed to delete contact - {str(e)}"
  • The core implementation in GoogleContactsService that calls the Google People API to delete the contact by resource name.
    def delete_contact(self, resource_name: str) -> Dict: """Delete a contact by resource name.""" try: self.service.people().deleteContact( resourceName=resource_name ).execute() return {'success': True, 'resourceName': resource_name} except HttpError as error: raise GoogleContactsError(f"Error deleting contact: {error}")
  • The call to register_tools(mcp) which defines and registers all MCP tools, including delete_contact.
    register_tools(mcp)

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