Skip to main content
Glama

xero_invoices_list

List Xero invoices with pagination. Optionally filter by status (DRAFT, SUBMITTED, etc.) and type (ACCREC for sales, ACCPAY for bills).

Instructions

List invoices in Xero with pagination. Optionally filter by status and type (ACCREC for sales, ACCPAY for bills).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (1-based, default: 1). Each page returns up to 100 invoices.
StatusNoFilter by invoice status
TypeNoFilter by invoice type: ACCREC (accounts receivable / sales invoices) or ACCPAY (accounts payable / bills)

Implementation Reference

  • The handler for xero_invoices_list tool. It extracts page/Status/Type args, optionally elicits a date range from the user if no filters provided, builds a 'where' clause, calls client.get('Invoices', params), and returns the JSON response.
    case "xero_invoices_list": {
      const { page, Status, Type } = args as {
        page?: number;
        Status?: string;
        Type?: string;
      };
      let startDate: string | undefined;
      let endDate: string | undefined;
    
      // If no filters provided, ask the user for a date range
      if (!Status && !Type && page === undefined) {
        const from = await elicitText(
          "Would you like to filter invoices by date range? Enter a start date, or leave blank to list all.",
          "startDate",
          "Start date (YYYY-MM-DD)"
        );
        if (from) {
          startDate = from;
          const to = await elicitText(
            "Enter an end date for the invoice filter.",
            "endDate",
            "End date (YYYY-MM-DD)"
          );
          if (to) endDate = to;
        }
      }
    
      const params: Record<string, string> = {};
      if (page !== undefined) params.page = String(page);
    
      // Build where clause from filters
      const filters: string[] = [];
      if (Status) filters.push(`Status=="${Status}"`);
      if (Type) filters.push(`Type=="${Type}"`);
      if (startDate) filters.push(`Date >= DateTime(${startDate.replace(/-/g, ",")})`);
      if (endDate) filters.push(`Date <= DateTime(${endDate.replace(/-/g, ",")})`);
      if (filters.length > 0) params.where = filters.join(" AND ");
    
      const response = await client.get("Invoices", params);
      return {
        content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
      };
    }
  • The input schema definition for xero_invoices_list tool, part of the invoiceTools array. Defines optional parameters: page (number), Status (enum: DRAFT/SUBMITTED/AUTHORISED/PAID/VOIDED/DELETED), and Type (enum: ACCREC/ACCPAY).
    {
      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)",
          },
        },
      },
    },
  • src/index.ts:258-259 (registration)
    The routing registration in the MCP server's CallToolRequestSchema handler. Tools starting with 'xero_invoices_' are dispatched to handleInvoiceTool(name, toolArgs).
    if (name.startsWith("xero_invoices_")) {
      return await handleInvoiceTool(name, toolArgs);
  • src/index.ts:195-198 (registration)
    The ListTools handler that registers all invoice tools (including xero_invoices_list) as available. They are collected via getAllDomainTools() which merges domain tool arrays.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      const domainTools = getAllDomainTools();
      return { tools: [navigateTool, statusTool, backTool, ...domainTools] };
    });
  • The XeroClient.get() method used by the invoices_list handler to make the GET request to the Xero API 'Invoices' endpoint with query params.
    async get(path: string, params?: Record<string, string>): Promise<unknown> {
      return this.request("GET", path, params);
Behavior4/5

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

Discloses pagination limit (100 per page) and parameter meanings like ACCREC= sales, ACCPAY= bills. No annotation coverage, but description adequately covers key behaviors.

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 sentences, front-loaded with main action and pagination, then filters. No waste.

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

Completeness5/5

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

Covers all essential aspects for a list tool with filters and pagination; output schema is not needed for this level of detail.

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?

Adds pagination detail and clarifies type enums beyond schema descriptions, which already have 100% coverage.

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?

Clearly states 'List invoices in Xero with pagination' with optional filters, distinguishing it from siblings like get (single) and create.

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

Usage Guidelines4/5

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

Implies usage for listing with filters, but lacks explicit when-not-to-use or comparison to similar tools like reports.

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