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
| Name | Required | Description | Default |
|---|---|---|---|
| invoiceId | Yes | The unique invoice ID (UUID) |
Implementation Reference
- src/domains/invoices.ts:197-203 (handler)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) }], }; } - src/domains/invoices.ts:38-51 (schema)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"], }, - src/domains/invoices.ts:12-141 (registration)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); - src/utils/client.ts:83-85 (helper)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); }