Skip to main content
Glama

Xero MCP Server

Official
MIT License
293
128
  • Apple
  • Linux
list-xero-payroll-employees.handler.ts1.06 kB
import { xeroClient } from "../clients/xero-client.js"; import { Employee } from "xero-node"; import { XeroClientResponse } from "../types/tool-response.js"; import { formatError } from "../helpers/format-error.js"; import { getClientHeaders } from "../helpers/get-client-headers.js"; async function getPayrollEmployees(): Promise<Employee[]> { await xeroClient.authenticate(); // Call the Employees endpoint from the PayrollNZApi const employees = await xeroClient.payrollNZApi.getEmployees( xeroClient.tenantId, undefined, // page undefined, // pageSize getClientHeaders(), ); return employees.body.employees ?? []; } /** * List all payroll employees from Xero */ export async function listXeroPayrollEmployees(): Promise< XeroClientResponse<Employee[]> > { try { const employees = await getPayrollEmployees(); return { result: employees, isError: false, error: null, }; } catch (error) { return { result: null, isError: true, error: formatError(error), }; } }

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