Skip to main content
Glama
Lucid-Drone-Technologies

Paylocity MCP Server

update_employee

Modify employee records in Paylocity by updating personal information, job details, compensation, employment status, and benefit setup with required effective dates.

Instructions

Update an employee's information. Supports changing: personal info (name, address), job details (title, department, cost center, supervisor), compensation (pay rate, salary), employment status (active, terminated, leave), and benefit setup. All changes require an effective date where applicable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyIdNoPaylocity company ID (defaults to PAYLOCITY_COMPANY_ID env var)
employeeIdYesPaylocity employee ID
updatesYesFields to update

Implementation Reference

  • Implementation of the 'update_employee' MCP tool, handling input validation, payload construction, and API request.
    server.tool(
      "update_employee",
      `Update an employee's information. Supports changing: personal info (name, address),
    job details (title, department, cost center, supervisor), compensation (pay rate, salary),
    employment status (active, terminated, leave), and benefit setup.
    All changes require an effective date where applicable.`,
      {
        companyId: companyIdParam,
        employeeId: z.string().describe("Paylocity employee ID"),
        updates: z
          .object({
            // Personal
            firstName: z.string().optional(),
            lastName: z.string().optional(),
            address1: z.string().optional(),
            address2: z.string().optional(),
            city: z.string().optional(),
            state: z.string().optional(),
            zip: z.string().optional(),
            personalEmailAddress: z.string().optional(),
            homePhone: z.string().optional(),
            personalMobilePhone: z.string().optional(),
            // Status
            employeeStatus: z
              .enum(["A", "T", "L"])
              .optional()
              .describe("A=Active, T=Terminated, L=Leave"),
            empStatusChangeReason: z.string().optional(),
            empStatusEffectiveDate: z
              .string()
              .optional()
              .describe("YYYY-MM-DD"),
            eligibleForRehire: z.boolean().optional(),
            // Department / Position
            departmentPosition: z
              .object({
                jobTitle: z.string().optional(),
                costCenter1: z.string().optional(),
                costCenter2: z.string().optional(),
                costCenter3: z.string().optional(),
                employeeType: z.string().optional().describe("RFT, RPT, SNL, TFT, TPT"),
                supervisorCompanyNumber: z.string().optional(),
                supervisorEmployeeId: z.string().optional(),
                effectiveDate: z.string().optional().describe("YYYY-MM-DD"),
                changeReason: z.string().optional(),
              })
              .optional(),
            // Pay rate
            primaryPayRate: z
              .object({
                payType: z.string().optional().describe("Salary or Hourly"),
                salary: z.number().optional(),
                annualSalary: z.number().optional(),
                baseRate: z.number().optional(),
                defaultHours: z.number().optional(),
                payFrequency: z.string().optional().describe("S=Semi-monthly, B=Biweekly, W=Weekly, M=Monthly"),
                effectiveDate: z.string().optional().describe("YYYY-MM-DD"),
                reason: z.string().optional(),
              })
              .optional(),
            // Benefit setup
            benefitSetup: z
              .object({
                benefitClass: z.string().optional(),
                benefitClassEffectiveDate: z.string().optional(),
                benefitSalary: z.number().optional(),
                benefitSalaryEffectiveDate: z.string().optional(),
              })
              .optional(),
          })
          .describe("Fields to update"),
      },
      async ({ companyId, employeeId, updates }) => {
        try {
          const cid = resolveCompanyId(companyId);
    
          // Build the updateEmployee payload — nest arrays where Paylocity expects them
          const payload: Record<string, any> = {
            companyNumber: cid,
            employeeId,
          };
    
          // Flat personal/status fields
          const flatFields = [
            "firstName",
            "lastName",
            "address1",
            "address2",
            "city",
            "state",
            "zip",
            "personalEmailAddress",
            "homePhone",
            "personalMobilePhone",
            "employeeStatus",
            "empStatusChangeReason",
            "empStatusEffectiveDate",
            "eligibleForRehire",
          ] as const;
    
          for (const f of flatFields) {
            if ((updates as any)[f] !== undefined) {
              payload[f] = (updates as any)[f];
            }
          }
    
          // Nested array fields (Paylocity expects these as single-element arrays)
          if (updates.departmentPosition) {
            payload.departmentPosition = [updates.departmentPosition];
          }
          if (updates.primaryPayRate) {
            payload.primaryPayRate = [updates.primaryPayRate];
          }
          if (updates.benefitSetup) {
            payload.benefitSetup = [updates.benefitSetup];
          }
    
          const result = await client.patch(
            `/v2/companies/${cid}/employees/${employeeId}`,
            { updateEmployee: payload }
          );
    
          // Invalidate directory cache since employee data changed
          directoryCacheTime = 0;
    
          return ok({ success: true, result: redact(result) });
        } catch (e) {
          return err(e);
        }
      }
    );
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full disclosure burden. It successfully notes the effective date requirement but fails to disclose mutation characteristics: idempotency, error behavior when employee missing, whether partial updates are supported, or what the response indicates.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Optimal structure: single opening sentence establishes purpose, followed by categorized field list, ending with critical constraint. No redundant words despite high parameter complexity. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given high schema coverage (100%) and complex nested structure, the description provides sufficient context by mapping schema fields to business concepts (cost center, supervisor, benefit class). Missing return value documentation is acceptable without output schema; only minor gap is lack of error scenario mention.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, baseline is 3. The description adds value by categorizing the nested 'updates' fields into logical groups (personal, job, compensation) and emphasizing the effective date constraint that applies across multiple nested objects, aiding comprehension of the complex schema structure.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verb 'Update' with resource 'employee's information' and comprehensively lists updatable field categories (personal info, job details, compensation, status, benefits). The verb clearly distinguishes this from sibling 'add_employee' (create vs update semantics).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides critical constraint that 'All changes require an effective date where applicable,' which guides temporal usage. However, lacks explicit when-not-to-use guidance (e.g., distinguishing from 'add_employee' for new hires) or prerequisite mentions (e.g., employee must exist).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/Lucid-Drone-Technologies/paylocity-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server