Skip to main content
Glama

Xero MCP Server

Official
MIT License
293
128
  • Apple
  • Linux
list-payroll-timesheets.tool.ts1.56 kB
import { Timesheet } from "xero-node/dist/gen/model/payroll-nz/timesheet.js"; import { listXeroPayrollTimesheets, } from "../../handlers/list-xero-timesheets.handler.js"; import { CreateXeroTool } from "../../helpers/create-xero-tool.js"; const ListPayrollTimesheetsTool = CreateXeroTool( "list-timesheets", `List all payroll timesheets in Xero. This retrieves comprehensive timesheet details including timesheet IDs, employee IDs, start and end dates, total hours, and the last updated date.`, {}, async () => { const response = await listXeroPayrollTimesheets(); if (response.isError) { return { content: [ { type: "text" as const, text: `Error listing timesheets: ${response.error}`, }, ], }; } const timesheets = response.result; return { content: [ { type: "text" as const, text: `Found ${timesheets?.length || 0} timesheets:`, }, ...(timesheets?.map((timesheet: Timesheet) => ({ 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 ListPayrollTimesheetsTool;

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