Skip to main content
Glama

Xero MCP Server

Official
MIT License
293
128
  • Apple
  • Linux
update-xero-payroll-timesheet-update-line.handler.ts1.32 kB
import { TimesheetLine, } from "xero-node/dist/gen/model/payroll-nz/timesheetLine.js"; import { xeroClient } from "../clients/xero-client.js"; import { formatError } from "../helpers/format-error.js"; import { XeroClientResponse } from "../types/tool-response.js"; async function updateTimesheetLine( timesheetID: string, timesheetLineID: string, timesheetLine: TimesheetLine ): Promise<TimesheetLine | null> { await xeroClient.authenticate(); // Call the updateTimesheetLine endpoint from the PayrollNZApi const updatedLine = await xeroClient.payrollNZApi.updateTimesheetLine( xeroClient.tenantId, timesheetID, timesheetLineID, timesheetLine, ); return updatedLine.body.timesheetLine ?? null; } /** * Update an existing timesheet line in a payroll timesheet in Xero */ export async function updateXeroPayrollTimesheetUpdateLine( timesheetID: string, timesheetLineID: string, timesheetLine: TimesheetLine ): Promise<XeroClientResponse<TimesheetLine | null>> { try { const updatedLine = await updateTimesheetLine(timesheetID, timesheetLineID, timesheetLine); return { result: updatedLine, 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