Skip to main content
Glama

Xero MCP Server

Official
MIT License
293
128
  • Apple
  • Linux
list-aged-payables-by-contact.tool.ts2.21 kB
import { z } from "zod"; import { CreateXeroTool } from "../../helpers/create-xero-tool.js"; import { formatAgedReportFilter } from "../../helpers/format-aged-report-filter.js"; import { listXeroAgedPayablesByContact } from "../../handlers/list-aged-payables-by-contact.handler.js"; const ListAgedPayablesByContact = CreateXeroTool( "list-aged-payables-by-contact", `Lists the aged payables in Xero. This shows aged payables for a certain contact up to a report date.`, { contactId: z.string(), reportDate: z.string().optional() .describe("Optional date to retrieve aged payables in YYYY-MM-DD format. If none is provided, defaults to end of the current month."), invoicesFromDate: z.string().optional() .describe("Optional from date in YYYY-MM-DD format. If provided, will only show payable invoices after this date for the contact."), invoicesToDate: z.string().optional() .describe("Optional to date in YYYY-MM-DD format. If provided, will only show payable invoices before this date for the contact."), }, async ({ contactId, reportDate, invoicesFromDate, invoicesToDate }) => { const response = await listXeroAgedPayablesByContact(contactId, reportDate, invoicesFromDate, invoicesToDate); if (response.isError) { return { content: [ { type: "text" as const, text: `Error listing aged payables by contact: ${response.error}`, }, ], }; } const agedPayablesReport = response.result; const filter = formatAgedReportFilter(invoicesFromDate, invoicesToDate); return { content: [ { type: "text" as const, text: `Report Name: ${agedPayablesReport.reportName || "Not specified"}`, }, { type: "text" as const, text: `Report Date: ${agedPayablesReport.reportDate || "Not specified"}` }, { type: "text" as const, text: filter ?? "Showing all relevant invoices" }, { type: "text" as const, text: JSON.stringify(agedPayablesReport.rows, null, 2), } ], }; } ); export default ListAgedPayablesByContact;

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