Skip to main content
Glama

Xero MCP Server

Official
MIT License
293
128
  • Apple
  • Linux
get-payroll-timesheet.tool.ts1.69 kB
import { z } from "zod"; import { getXeroPayrollTimesheet, } from "../../handlers/get-xero-payroll-timesheet.handler.js"; import { CreateXeroTool } from "../../helpers/create-xero-tool.js"; const GetPayrollTimesheetTool = CreateXeroTool( "get-timesheet", `Retrieve a single payroll timesheet from Xero by its ID. This provides details such as the timesheet ID, employee ID, start and end dates, total hours, and the last updated date.`, { timesheetID: z.string().describe("The ID of the timesheet to retrieve."), }, async (params: { timesheetID: string }) => { const { timesheetID } = params; const response = await getXeroPayrollTimesheet(timesheetID); if (response.isError) { return { content: [ { type: "text" as const, text: `Error retrieving timesheet: ${response.error}`, }, ], }; } const timesheet = response.result; if (!timesheet) { return { content: [ { type: "text" as const, text: `No timesheet found with ID: ${timesheetID}`, }, ], }; } return { content: [ { type: "text" as const, text: [ `Timesheet ID: ${timesheet.timesheetID}`, `Employee ID: ${timesheet.employeeID}`, `Start Date: ${timesheet.startDate}`, `End Date: ${timesheet.endDate}`, `Total Hours: ${timesheet.totalHours}`, `Last Updated: ${timesheet.updatedDateUTC}`, ] .filter(Boolean) .join("\n"), }, ], }; }, ); export default GetPayrollTimesheetTool;

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