Skip to main content
Glama
XeroAPI

Xero MCP Server

Official

list-quotes

Retrieve quotes from Xero accounting software. Specify a contact to filter results or paginate through multiple pages of quotes as needed.

Instructions

List all quotes in Xero. Ask the user if they want to see quotes for a specific contact before running. Ask the user if they want the next page of quotes after running this tool if 10 quotes are returned. If they do, call this tool again with the page number and the contact provided in the previous call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageYes
contactIdNo
quoteNumberNo

Implementation Reference

  • Core handler logic for the 'list-quotes' tool: invokes the Xero quotes API handler, processes the response, and formats quotes into detailed text blocks for each quote.
    async ({ page, contactId, quoteNumber }) => {
      const response = await listXeroQuotes(page, contactId, quoteNumber);
      if (response.error !== null) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Error listing quotes: ${response.error}`,
            },
          ],
        };
      }
    
      const quotes = response.result;
    
      return {
        content: [
          {
            type: "text" as const,
            text: `Found ${quotes?.length || 0} quotes:`,
          },
          ...(quotes?.map((quote) => ({
            type: "text" as const,
            text: [
              `Quote ID: ${quote.quoteID}`,
              `Quote Number: ${quote.quoteNumber}`,
              quote.reference ? `Reference: ${quote.reference}` : null,
              `Status: ${quote.status || "Unknown"}`,
              quote.contact
                ? `Contact: ${quote.contact.name} (${quote.contact.contactID})`
                : null,
              quote.dateString ? `Quote Date: ${quote.dateString}` : null,
              quote.expiryDateString
                ? `Expiry Date: ${quote.expiryDateString}`
                : null,
              quote.title ? `Title: ${quote.title}` : null,
              quote.summary ? `Summary: ${quote.summary}` : null,
              quote.terms ? `Terms: ${quote.terms}` : null,
              quote.lineAmountTypes
                ? `Line Amount Types: ${quote.lineAmountTypes}`
                : null,
              quote.subTotal ? `Sub Total: ${quote.subTotal}` : null,
              quote.totalTax ? `Total Tax: ${quote.totalTax}` : null,
              `Total: ${quote.total || 0}`,
              quote.totalDiscount
                ? `Total Discount: ${quote.totalDiscount}`
                : null,
              quote.currencyCode ? `Currency: ${quote.currencyCode}` : null,
              quote.currencyRate ? `Currency Rate: ${quote.currencyRate}` : null,
              quote.updatedDateUTC
                ? `Last Updated: ${quote.updatedDateUTC}`
                : null,
            ]
              .filter(Boolean)
              .join("\n"),
          })) || []),
        ],
      };
    },
  • Input schema for the 'list-quotes' tool using Zod: requires 'page' (number), optional 'contactId' and 'quoteNumber' (strings).
      page: z.number(),
      contactId: z.string().optional(),
      quoteNumber: z.string().optional(),
    },
  • Import and registration of ListQuotesTool into the ListTools array, making it available for tool server registration.
    import ListQuotesTool from "./list-quotes.tool.js";
    import ListReportBalanceSheetTool from "./list-report-balance-sheet.tool.js";
    import ListTaxRatesTool from "./list-tax-rates.tool.js";
    import ListTrackingCategoriesTool from "./list-tracking-categories.tool.js";
    import ListTrialBalanceTool from "./list-trial-balance.tool.js";
    import ListContactGroupsTool from "./list-contact-groups.tool.js";
    
    export const ListTools = [
      ListAccountsTool,
      ListContactsTool,
      ListCreditNotesTool,
      ListInvoicesTool,
      ListItemsTool,
      ListManualJournalsTool,
      ListQuotesTool,
  • Helper function that fetches quotes from Xero API using the authenticated client, handles pagination, filtering by contact or number, and error formatting.
    export async function listXeroQuotes(
      page: number = 1,
      contactId?: string,
      quoteNumber?: string,
    ): Promise<XeroClientResponse<Quote[]>> {
      try {
        const quotes = await getQuotes(contactId, page, quoteNumber);
    
        return {
          result: quotes,
          isError: false,
          error: null,
        };
      } catch (error) {
        return {
          result: null,
          isError: true,
          error: formatError(error),
        };
      }
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it's a read operation (implied by 'List'), includes pagination behavior (returns 10 quotes per page, requires re-call for next page), and requires user interaction for filtering. However, it doesn't mention rate limits, authentication needs, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized (4 sentences) but not optimally structured. It front-loads the core purpose but mixes implementation instructions (user prompts) with tool behavior. Some sentences could be more streamlined, though all add value.

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 3 parameters with 0% schema coverage, no annotations, and no output schema, the description provides moderate context. It covers pagination behavior and user interaction needs but misses details on parameter usage (especially quoteNumber), return format, and error cases, leaving room for improvement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage for its 3 parameters (page, contactId, quoteNumber). The description only partially compensates: it mentions 'page number' and 'contact' in the context of pagination, but doesn't explain contactId's purpose for filtering or quoteNumber at all. This leaves significant gaps in parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List all quotes') and resource ('in Xero'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'list-invoices' or 'list-credit-notes' beyond the resource type, missing explicit distinction.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: it instructs to ask the user about contact filtering before running and about pagination after running if 10 quotes are returned. It also specifies to call the tool again with page and contact parameters for pagination, offering clear usage 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/XeroAPI/xero-mcp-server'

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