Skip to main content
Glama

xero_invoices_get

Retrieve full details of an invoice, including line items, amounts, and payment status, by providing its unique ID.

Instructions

Get detailed information about a specific invoice by its ID. Returns full invoice details including line items, amounts, and payment status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceIdYesThe unique invoice ID (UUID)

Implementation Reference

  • Handler for xero_invoices_get tool. Extracts invoiceId from args, makes a GET request to the Xero API endpoint Invoices/{invoiceId}, and returns the full invoice details as JSON.
    case "xero_invoices_get": {
      const { invoiceId } = args as { invoiceId: string };
      const response = await client.get(`Invoices/${invoiceId}`);
      return {
        content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
      };
    }
  • Input schema definition for xero_invoices_get. Accepts a required 'invoiceId' (UUID string) parameter.
    {
      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"],
      },
  • The 'invoiceTools' array which includes xero_invoices_get in its list of tool definitions, making it available for registration with the MCP 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"],
        },
      },
    ];
  • src/index.ts:258-259 (registration)
    Routing registration: xero_invoices_* tools are routed to handleInvoiceTool, which handles xero_invoices_get via a switch-case.
    if (name.startsWith("xero_invoices_")) {
      return await handleInvoiceTool(name, toolArgs);
  • The XeroClient.get() method used by the handler to make a GET request to the Xero API with Bearer token authentication.
    async get(path: string, params?: Record<string, string>): Promise<unknown> {
      return this.request("GET", path, params);
    }
Behavior3/5

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

No annotations provided, so description carries full burden. States it returns full details but omits behavioral traits like permissions, idempotence, or side effects. For a read operation, this is adequate but not comprehensive.

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?

Two concise sentences, front-loaded with purpose. No redundant or irrelevant information.

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

Completeness4/5

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

For a simple get-by-ID operation with no output schema, description sufficiently covers return content (line items, amounts, status). Sibling context provided, but could mention pagination or error handling.

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 has 100% coverage with a clear description of 'invoiceId' as UUID. Description adds 'detailed information about a specific invoice' but does not exceed schema meaning. Baseline 3 applies.

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?

Description clearly states the action (get), resource (invoice), and what is returned (detailed info including line items, amounts, payment status). Distinguishes from siblings like xero_invoices_list and xero_invoices_create.

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?

Implies usage when a specific invoice ID is known and full details are needed, but does not explicitly state when to use this versus other invoice tools (e.g., list, update). No exclusions or alternatives mentioned.

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