get_pay_statements
Retrieve employee pay statement data including gross/net pay, hours, taxes, deductions, and earnings for a specific year, with optional filtering by check date.
Instructions
Get pay statement data for an employee by year. Returns both summary (gross pay, net pay, hours, direct deposit amounts) and line-item details (each tax, deduction, and earning). Optionally filter to a specific check date.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| companyId | No | Paylocity company ID (defaults to PAYLOCITY_COMPANY_ID env var) | |
| employeeId | Yes | Paylocity employee ID | |
| year | Yes | Tax year (e.g. 2025) | |
| checkDate | No | Check date YYYY-MM-DD (optional — omit for all checks in the year) |
Implementation Reference
- src/server.ts:289-319 (handler)Registration and handler implementation for the "get_pay_statements" tool in src/server.ts. It fetches both summary and details from the Paylocity API for the specified employee and year, then redacts the output.
server.tool( "get_pay_statements", `Get pay statement data for an employee by year. Returns both summary (gross pay, net pay, hours, direct deposit amounts) and line-item details (each tax, deduction, and earning). Optionally filter to a specific check date.`, { companyId: companyIdParam, employeeId: z.string().describe("Paylocity employee ID"), year: z.string().describe("Tax year (e.g. 2025)"), checkDate: z .string() .optional() .describe("Check date YYYY-MM-DD (optional — omit for all checks in the year)"), }, async ({ companyId, employeeId, year, checkDate }) => { try { const cid = resolveCompanyId(companyId); const suffix = checkDate ? `/${year}/${checkDate}` : `/${year}`; const base = `/v2/companies/${cid}/employees/${employeeId}/paystatement`; const [summary, details] = await Promise.all([ client.get(`${base}/summary${suffix}`), client.get(`${base}/details${suffix}`), ]); return ok(redact({ summary, details })); } catch (e) { return err(e); } } );