Skip to main content
Glama

Xero MCP Server

Invoices.ts1.22 kB
import { XeroClientSession } from "../../XeroApiClient.js"; import { IMcpServerTool } from "../IMcpServerTool.js"; import { z } from "zod"; export const ListInvoicesTool: IMcpServerTool = { requestSchema: { name: "list_invoices", description: "Retrieves sales invoices or purchase bills", inputSchema: { type: "object", properties: { where: { type: "string", description: "Filter invoices. See example", example: "Date >= DateTime(2015, 01, 01) && Date < DateTime(2015, 12, 31), DueDate < DateTime(2015, 12, 31)", }, }, }, output: { content: [{ type: "text", text: z.string() }] }, }, requestHandler: async (request) => { const whereClause = request.params.arguments ? (request.params.arguments.where as string) : undefined; const response = await XeroClientSession.xeroClient.accountingApi.getInvoices( XeroClientSession.activeTenantId()!!, undefined, whereClause ); const invoices = response.body.invoices || []; return { content: [ { type: "text", text: JSON.stringify(invoices), }, ], }; }, };

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/john-zhang-dev/xero-mcp'

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