Skip to main content
Glama

xero_invoices_update_status

Update an invoice's status to submitted, authorised, or voided.

Instructions

Update the status of an existing invoice. Can submit, authorise, or void an invoice.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceIdYesThe invoice ID to update (required)
StatusYesNew status for the invoice (required)

Implementation Reference

  • The handler function that executes the 'xero_invoices_update_status' tool logic. It extracts invoiceId and Status from args and makes a POST request to Invoices/{invoiceId} to update the invoice status.
    case "xero_invoices_update_status": {
      const { invoiceId, Status } = args as {
        invoiceId: string;
        Status: string;
      };
    
      const response = await client.post(`Invoices/${invoiceId}`, {
        InvoiceID: invoiceId,
        Status,
      });
      return {
        content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
      };
    }
  • The schema definition for the tool, defining its name, description, and input validation (invoiceId string + Status enum of SUBMITTED, AUTHORISED, VOIDED, both required).
    {
      name: "xero_invoices_update_status",
      description:
        "Update the status of an existing invoice. Can submit, authorise, or void an invoice.",
      inputSchema: {
        type: "object",
        properties: {
          invoiceId: {
            type: "string",
            description: "The invoice ID to update (required)",
          },
          Status: {
            type: "string",
            enum: ["SUBMITTED", "AUTHORISED", "VOIDED"],
            description: "New status for the invoice (required)",
          },
        },
        required: ["invoiceId", "Status"],
      },
    },
  • src/index.ts:258-259 (registration)
    The tool routing/registration in the main index.ts file. All xero_invoices_* tools (including xero_invoices_update_status) are routed to handleInvoiceTool.
    if (name.startsWith("xero_invoices_")) {
      return await handleInvoiceTool(name, toolArgs);
  • The invoiceTools array (and the handleInvoiceTool function) are exported from invoices.ts and imported into index.ts, linking the tool definitions and handler to the main server.
    export const invoiceTools: Tool[] = [
      {
        name: "xero_invoices_list",
        description:
          "List invoices in Xero with pagination. Optionally filter by status and type (ACCREC for sales, ACCPAY for bills).",
        inputSchema: {
          type: "object",
          properties: {
            page: {
              type: "number",
              description: "Page number (1-based, default: 1). Each page returns up to 100 invoices.",
            },
            Status: {
              type: "string",
              enum: ["DRAFT", "SUBMITTED", "AUTHORISED", "PAID", "VOIDED", "DELETED"],
              description: "Filter by invoice status",
            },
            Type: {
              type: "string",
              enum: ["ACCREC", "ACCPAY"],
              description:
                "Filter by invoice type: ACCREC (accounts receivable / sales invoices) or ACCPAY (accounts payable / bills)",
            },
          },
        },
      },
      {
        name: "xero_invoices_get",
        description:
          "Get detailed information about a specific invoice by its ID. Returns full invoice details including line items, amounts, and payment status.",
        inputSchema: {
          type: "object",
          properties: {
            invoiceId: {
              type: "string",
              description: "The unique invoice ID (UUID)",
            },
          },
          required: ["invoiceId"],
        },
      },
      {
        name: "xero_invoices_create",
        description:
          "Create a new invoice in Xero. Requires type, contact, and at least one line item.",
        inputSchema: {
          type: "object",
          properties: {
            Type: {
              type: "string",
              enum: ["ACCREC", "ACCPAY"],
              description:
                "Invoice type: ACCREC (sales invoice) or ACCPAY (bill) (required)",
            },
            ContactID: {
              type: "string",
              description: "The contact ID to create the invoice for (required)",
            },
            LineItems: {
              type: "array",
              description: "Array of line items (required). Each item needs Description, Quantity, UnitAmount, and AccountCode.",
              items: {
                type: "object",
                properties: {
                  Description: {
                    type: "string",
                    description: "Line item description",
                  },
                  Quantity: {
                    type: "number",
                    description: "Quantity",
                  },
                  UnitAmount: {
                    type: "number",
                    description: "Unit price",
                  },
                  AccountCode: {
                    type: "string",
                    description: "Account code for the line item",
                  },
                  TaxType: {
                    type: "string",
                    description: "Tax type code (e.g., OUTPUT, INPUT, NONE)",
                  },
                },
                required: ["Description", "Quantity", "UnitAmount", "AccountCode"],
              },
            },
            Date: {
              type: "string",
              description: "Invoice date in YYYY-MM-DD format",
            },
            DueDate: {
              type: "string",
              description: "Due date in YYYY-MM-DD format",
            },
            Reference: {
              type: "string",
              description: "Invoice reference/PO number",
            },
            Status: {
              type: "string",
              enum: ["DRAFT", "SUBMITTED", "AUTHORISED"],
              description: "Initial invoice status (default: DRAFT)",
            },
          },
          required: ["Type", "ContactID", "LineItems"],
        },
      },
      {
        name: "xero_invoices_update_status",
        description:
          "Update the status of an existing invoice. Can submit, authorise, or void an invoice.",
        inputSchema: {
          type: "object",
          properties: {
            invoiceId: {
              type: "string",
              description: "The invoice ID to update (required)",
            },
            Status: {
              type: "string",
              enum: ["SUBMITTED", "AUTHORISED", "VOIDED"],
              description: "New status for the invoice (required)",
            },
          },
          required: ["invoiceId", "Status"],
        },
      },
    ];
Behavior3/5

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

With no annotations provided, the description carries full burden. It lists allowed status transitions (SUBMITTED, AUTHORISED, VOIDED) but does not disclose prerequisites (e.g., invoice state requirements) or side effects (e.g., voiding may affect payments). Basic transparency is present but not enriched.

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 exceptionally concise with two short sentences. Every word serves a purpose, and the key information (update status, possible actions) is front-loaded. No redundancy or fluff.

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 that there is no output schema, the description does not indicate what the response will contain (e.g., updated invoice object). While the tool is simple, an agent would benefit from knowing if the updated invoice is returned. Still, the description is adequate for a straightforward update operation.

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 input schema already describes both parameters with 100% coverage. The description adds meaning by mapping the Status enum to real-world actions ('submit, authorise, or void'), which helps the agent understand the purpose of each value beyond the schema labels.

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 verb ('update'), the resource ('invoice'), and the specific actions ('submit, authorise, or void'), which distinguishes it from sibling tools like create, get, or list. The purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool (when changing invoice status) but does not explicitly state when not to use it or suggest alternatives. For example, it could mention not to use for generating invoices or retrieving them, but it relies on sibling context.

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