UNPKG

xero-mcp

Version:

A Model Context Protocol server allows Clients to interact with Xero

21 lines (20 loc) 711 B
import { XeroClientSession } from "../../XeroApiClient.js"; export const ListOrganisationsTool = { requestSchema: { name: "list_organisations", description: "Retrieves Xero organisation details", inputSchema: { type: "object", properties: {} }, }, requestHandler: async () => { const response = await XeroClientSession.xeroClient.accountingApi.getOrganisations(XeroClientSession.activeTenantId()); const organisations = response.body.organisations || []; return { content: [ { type: "text", text: JSON.stringify(organisations), }, ], }; }, };