Skip to main content
Glama

xero_contacts_create

Create a new contact in Xero. Provide the required name and optionally add email, phone, tax number, and customer/supplier status.

Instructions

Create a new contact in Xero. Name is required; other fields are optional.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
NameYesContact name (required)
EmailAddressNoContact email address
FirstNameNoContact first name
LastNameNoContact last name
PhoneNoContact phone number
AccountNumberNoAccount number for the contact
TaxNumberNoTax number (ABN in Australia, GST in NZ, VAT in UK)
IsCustomerNoWhether the contact is a customer
IsSupplierNoWhether the contact is a supplier

Implementation Reference

  • Input schema definition for the xero_contacts_create tool. Requires Name (string), with optional fields: EmailAddress, FirstName, LastName, Phone, AccountNumber, TaxNumber, IsCustomer, IsSupplier.
    {
      name: "xero_contacts_create",
      description:
        "Create a new contact in Xero. Name is required; other fields are optional.",
      inputSchema: {
        type: "object",
        properties: {
          Name: {
            type: "string",
            description: "Contact name (required)",
          },
          EmailAddress: {
            type: "string",
            description: "Contact email address",
          },
          FirstName: {
            type: "string",
            description: "Contact first name",
          },
          LastName: {
            type: "string",
            description: "Contact last name",
          },
          Phone: {
            type: "string",
            description: "Contact phone number",
          },
          AccountNumber: {
            type: "string",
            description: "Account number for the contact",
          },
          TaxNumber: {
            type: "string",
            description: "Tax number (ABN in Australia, GST in NZ, VAT in UK)",
          },
          IsCustomer: {
            type: "boolean",
            description: "Whether the contact is a customer",
          },
          IsSupplier: {
            type: "boolean",
            description: "Whether the contact is a supplier",
          },
        },
        required: ["Name"],
      },
    },
  • Handler function for xero_contacts_create. Extracts fields from args, builds a contact object (with special handling for Phone mapped to Phones array), and posts it to the Xero API via client.post('Contacts', { Contacts: [contact] }).
    case "xero_contacts_create": {
      const {
        Name,
        EmailAddress,
        FirstName,
        LastName,
        Phone,
        AccountNumber,
        TaxNumber,
        IsCustomer,
        IsSupplier,
      } = args as {
        Name: string;
        EmailAddress?: string;
        FirstName?: string;
        LastName?: string;
        Phone?: string;
        AccountNumber?: string;
        TaxNumber?: string;
        IsCustomer?: boolean;
        IsSupplier?: boolean;
      };
    
      const contact: Record<string, unknown> = { Name };
      if (EmailAddress) contact.EmailAddress = EmailAddress;
      if (FirstName) contact.FirstName = FirstName;
      if (LastName) contact.LastName = LastName;
      if (Phone) {
        contact.Phones = [{ PhoneType: "DEFAULT", PhoneNumber: Phone }];
      }
      if (AccountNumber) contact.AccountNumber = AccountNumber;
      if (TaxNumber) contact.TaxNumber = TaxNumber;
      if (IsCustomer !== undefined) contact.IsCustomer = IsCustomer;
      if (IsSupplier !== undefined) contact.IsSupplier = IsSupplier;
    
      const response = await client.post("Contacts", { Contacts: [contact] });
      return {
        content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
      };
    }
  • src/index.ts:30-30 (registration)
    The contactTools array (which includes xero_contacts_create) is imported from './domains/contacts.js' at the top of the main server file.
    import { contactTools, handleContactTool } from "./domains/contacts.js";
  • src/index.ts:255-257 (registration)
    Routing registration: tools starting with 'xero_contacts_' (including xero_contacts_create) are dispatched to handleContactTool(name, toolArgs).
    if (name.startsWith("xero_contacts_")) {
      return await handleContactTool(name, toolArgs);
    }
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It mentions 'Create' (mutation) but omits details such as return values, required permissions, rate limits, failure modes, or side effects like duplicate handling.

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 a single short sentence with no wasted words, but it could be more informative while still being concise. Front-loading the key constraint (Name required) is good.

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?

Given 9 parameters, no output schema, and no annotations, the description is too brief. It lacks information on what the tool returns (e.g., created contact ID), error handling, or behavior for duplicate contacts.

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

Parameters3/5

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

All 9 parameters are fully described in the input schema (100% coverage), so the description's addition that 'Name is required; other fields are optional' adds minimal value beyond what the schema already indicates via the required array.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and the resource ('a new contact in Xero'), and explicitly notes that Name is required while others are optional. This differentiates it from sibling tools like get, list, or search.

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 (e.g., update contacts, search). It only states the required field but lacks context on prerequisites or common use cases.

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/wyre-technology/xero-mcp'

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