Skip to main content
Glama
Lucid-Drone-Technologies

Paylocity MCP Server

search_employees

Search employee directory by name, job title, email, or employee ID to find basic employee information and obtain employee IDs for detailed lookups.

Instructions

Search the employee directory by name, job title, email, or employee ID. Returns matching employees with basic info (name, title, department, status, supervisor). Use this first to find someone's employee ID, then use get_employee for full details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyIdNoPaylocity company ID (defaults to PAYLOCITY_COMPANY_ID env var)
queryYesSearch term — matches name, title, email, or employee ID
statusFilterNoFilter by status (default: all)

Implementation Reference

  • The handler function that executes the "search_employees" tool logic, including filtering and status processing.
    async ({ companyId, query, statusFilter }) => {
      try {
        const cid = resolveCompanyId(companyId);
        const dir = await getDirectory(cid);
        const q = query.toLowerCase();
        let results = dir.filter((e) => {
          const haystack =
            `${e.employeeId} ${e.firstName} ${e.lastName} ${e.jobTitle} ${e.workEmail}`.toLowerCase();
          return haystack.includes(q);
        });
    
        if (statusFilter === "active")
          results = results.filter((e) => e.status === "A");
        else if (statusFilter === "terminated")
          results = results.filter((e) => e.status === "T");
    
        return ok({ count: results.length, employees: results });
      } catch (e) {
        return err(e);
      }
  • src/server.ts:232-246 (registration)
    Registration of the "search_employees" tool with its schema definition and input parameters.
    server.tool(
      "search_employees",
      `Search the employee directory by name, job title, email, or employee ID.
    Returns matching employees with basic info (name, title, department, status, supervisor).
    Use this first to find someone's employee ID, then use get_employee for full details.`,
      {
        companyId: companyIdParam,
        query: z
          .string()
          .describe("Search term — matches name, title, email, or employee ID"),
        statusFilter: z
          .enum(["all", "active", "terminated"])
          .optional()
          .describe("Filter by status (default: all)"),
      },
Behavior4/5

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

No annotations provided, so description carries full burden. Compensates by disclosing return structure (basic info: name, title, department, status, supervisor) despite lacking output schema. Does not explicitly state read-only/safety properties or pagination behavior, preventing a 5.

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?

Three sentences with zero waste: purpose (sentence 1), return value (sentence 2), workflow guidance (sentence 3). Perfectly front-loaded with the most critical selection criteria first.

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

Completeness5/5

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

Comprehensive given constraints. Lacks output schema but description compensates by listing returned fields. Establishes clear relationship to sibling 'get_employee'. All 3 parameters fully documented in schema with description covering the semantic intent of the search.

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

Parameters3/5

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

Schema coverage is 100%, establishing baseline 3. Description lists searchable fields (name, title, email, employee ID) which aligns with but does not substantially augment the schema's parameter descriptions. No additional syntax or format guidance provided.

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?

Specific verb (Search) + resource (employee directory) + scope (by name, job title, email, or employee ID). Explicitly distinguishes from sibling 'get_employee' by describing this as directory search versus full record retrieval.

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

Usage Guidelines5/5

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

Explicit workflow guidance: 'Use this first to find someone's employee ID, then use get_employee for full details.' Clearly establishes the two-step pattern and when to prefer this tool over the sibling retrieval tool.

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