Skip to main content
Glama
XeroAPI

Xero MCP Server

Official
by XeroAPI

create-invoice

Generate invoices in Xero accounting software by specifying contact details, line items, and invoice type. Returns a direct link to view the created invoice.

Instructions

Create an invoice in Xero. When an invoice is created, a deep link to the invoice in Xero is returned. This deep link can be used to view the invoice in Xero directly. This link should be displayed to the user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contactIdYesThe ID of the contact to create the invoice for. Can be obtained from the list-contacts tool.
lineItemsYes
typeYesThe type of invoice to create. ACCREC is for sales invoices, Accounts Receivable, or customer invoices. ACCPAY is for purchase invoices, Accounts Payable invoices, supplier invoices, or bills. If the type is not specified, the default is ACCREC.
referenceNoA reference number for the invoice.
dateNoThe date the invoice was created (YYYY-MM-DD format).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed12 schema fields changedv1.0.0
    • addedInput schema / properties / contactId / description
      Added value: +"The ID of the contact to create the invoice for.       Can be obtained from the list-contacts tool."
    • addedInput schema / properties / date
      Added value: +{
      +  "description": "The date the invoice was created (YYYY-MM-DD format).",
      +  "type": "string"
      +}
    • addedInput schema / properties / lineItems / items / properties / accountCode / description
      Added value: +"The account code of the line item - can be obtained from the list-accounts tool"
    • addedInput schema / properties / lineItems / items / properties / description / description
      Added value: +"The description of the line item"
    • addedInput schema / properties / lineItems / items / properties / itemCode
      Added value: +{
      +  "description": "The item code of the line item - can be obtained from the list-items tool     If the item is not listed, add without an item code and ask the user if they would like to add an item code.",
      +  "type": "string"
      +}
    • addedInput schema / properties / lineItems / items / properties / quantity / description
      Added value: +"The quantity of the line item"
    • addedInput schema / properties / lineItems / items / properties / taxType / description
      Added value: +"The tax type of the line item - can be obtained from the list-tax-rates tool"
    • addedInput schema / properties / lineItems / items / properties / tracking
      Added value: +{
      +  "description": "Up to 2 tracking categories and options can be added to the line item.     Can be obtained from the list-tracking-categories tool.     Only use if prompted by the user.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "name": {
      +        "description": "The name of the tracking category. Can be obtained from the list-tracking-categories tool",
      +        "type": "string"
      +      },
      +      "option": {
      +        "description": "The name of the tracking option. Can be obtained from the list-tracking-categories tool",
      +        "type": "string"
      +      },
      +      "trackingCategoryID": {
      +        "description": "The ID of the tracking category.     Can be obtained from the list-tracking-categories tool",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "option",
      +      "trackingCategoryID"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / lineItems / items / properties / unitAmount / description
      Added value: +"The price per unit of the line item"
    • addedInput schema / properties / reference / description
      Added value: +"A reference number for the invoice."
    • addedInput schema / properties / type
      Added value: +{
      +  "description": "The type of invoice to create.       ACCREC is for sales invoices, Accounts Receivable, or customer invoices.       ACCPAY is for purchase invoices, Accounts Payable invoices, supplier invoices, or bills.       If the type is not specified, the default is ACCREC.",
      +  "enum": [
      +    "ACCREC",
      +    "ACCPAY"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "contactId",
      -  "lineItems"
      -]New value: +[
      +  "contactId",
      +  "lineItems",
      +  "type"
      +]
  2. First observed

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses that a deep link is returned and should be displayed, which is useful behavioral context. However, it lacks details on permissions needed, error handling, whether the operation is idempotent, or any rate limits—significant gaps for a creation tool with no annotation coverage.

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, front-loading the core purpose. The second and third sentences about the deep link are relevant but could be more integrated. No wasted words, though slight redundancy in mentioning the link twice.

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 and no output schema, the description is incomplete for a creation tool with 5 parameters. It covers the purpose and return behavior but misses critical context like error cases, side effects, or prerequisites (e.g., needing valid contactId from list-contacts). The schema handles parameters well, but overall guidance is minimal.

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?

Schema description coverage is 80%, so the baseline is 3. The description adds no parameter-specific information beyond what the schema provides (e.g., it doesn't explain 'lineItems' or 'type' further). It mentions the deep link return, but this relates to output, not input parameters.

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 specific action ('Create an invoice in Xero') and resource ('invoice'), distinguishing it from sibling tools like 'create-contact' or 'create-quote'. It also mentions the return value (a deep link), which adds specificity beyond just the verb.

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-invoice' or 'list-invoices'. It mentions the deep link should be displayed to the user, but this is a post-creation instruction, not usage context. No explicit when/when-not or alternative tools are referenced.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/XeroAPI/xero-mcp-server'

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