Skip to main content
Glama

create_contact

Generate and manage new contacts by inputting essential details like account ID, name, email, and phone numbers using Microsoft MCP's integration with Microsoft Graph API.

Instructions

Create a new contact

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYes
email_addressesNo
given_nameYes
phone_numbersNo
surnameNo

Implementation Reference

  • The main handler function for the 'create_contact' tool. It is decorated with @mcp.tool, which handles registration and schema inference based on the function signature and docstring. The function constructs a contact object using Microsoft Graph API and posts it to /me/contacts.
    @mcp.tool
    def create_contact(
        account_id: str,
        given_name: str,
        surname: str | None = None,
        email_addresses: str | list[str] | None = None,
        phone_numbers: dict[str, str] | None = None,
    ) -> dict[str, Any]:
        """Create a new contact"""
        contact: dict[str, Any] = {"givenName": given_name}
    
        if surname:
            contact["surname"] = surname
    
        if email_addresses:
            email_list = (
                [email_addresses] if isinstance(email_addresses, str) else email_addresses
            )
            contact["emailAddresses"] = [
                {"address": email, "name": f"{given_name} {surname or ''}".strip()}
                for email in email_list
            ]
    
        if phone_numbers:
            if "business" in phone_numbers:
                contact["businessPhones"] = [phone_numbers["business"]]
            if "home" in phone_numbers:
                contact["homePhones"] = [phone_numbers["home"]]
            if "mobile" in phone_numbers:
                contact["mobilePhone"] = phone_numbers["mobile"]
    
        result = graph.request("POST", "/me/contacts", account_id, json=contact)
        if not result:
            raise ValueError("Failed to create contact")
        return result
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'Create a new contact' implies a write operation but doesn't disclose behavioral traits like whether this requires specific permissions, what happens on duplicate contacts, if the operation is idempotent, or what the response contains. For a mutation tool with zero annotation coverage, this is a significant gap in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is maximally concise at three words, front-loading the core action. There's zero waste or redundancy. While it may be under-specified, it's structurally efficient with every word carrying essential meaning.

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

Completeness2/5

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

For a mutation tool with 5 parameters, 0% schema description coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain what data is needed, what the operation does beyond the basic verb, what permissions are required, or what to expect in return. The context demands more guidance than provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. 'Create a new contact' adds no meaning beyond the tool name - it doesn't explain what parameters are needed, their purposes, or relationships. With 5 parameters (2 required), the description fails to provide any semantic context about account_id, email_addresses, given_name, phone_numbers, or surname.

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 'Create a new contact' clearly states the verb ('create') and resource ('contact'), making the purpose immediately understandable. It distinguishes from siblings like 'update_contact' or 'delete_contact' by specifying creation rather than modification or deletion. However, it doesn't specify what constitutes a 'contact' in this system beyond the basic concept.

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. It doesn't mention prerequisites (like authentication), when to choose this over 'update_contact' for existing contacts, or any constraints on usage. With siblings like 'search_contacts' and 'get_contact', there's no indication of workflow relationships.

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

Related 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/elyxlz/microsoft-mcp'

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