fetch_employee_details
Retrieve specific employee information from Paylocity by providing company and employee IDs. This tool accesses employee data, earnings, taxes, and pay statements through the MCP server.
Instructions
Fetch details for a specific employee.
Args: company_id: Optional company ID (string or integer). If not provided, uses the first company ID from configuration. employee_id: Employee ID (string or integer) to get details for.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_id | No | ||
| employee_id | No |
Implementation Reference
- src/mcppaylocity/__init__.py:244-259 (handler)The main handler function for the 'fetch_employee_details' tool. It is registered via @mcp.tool() decorator, validates input, formats IDs, and delegates to PaylocityClient.get_employee_details() to fetch the data.@mcp.tool() def fetch_employee_details(company_id: Optional[Union[str, int]] = None, employee_id: Union[str, int] = None) -> Dict[str, Any]: """ Fetch details for a specific employee. Args: company_id: Optional company ID (string or integer). If not provided, uses the first company ID from configuration. employee_id: Employee ID (string or integer) to get details for. """ if employee_id is None: raise ValueError("employee_id is required") company_id_str = str(company_id) if company_id is not None else company_ids[0] employee_id_str = str(employee_id) return client.get_employee_details(company_id_str, employee_id_str)
- Supporting method in PaylocityClient class that constructs the API endpoint and makes the authenticated HTTP request to retrieve employee details from Paylocity API.def get_employee_details(self, company_id, employee_id): """Get detailed employee information with automatic token management""" endpoint = "/api/v2/companies/{}/{}".format(company_id, employee_id) return self._make_request("GET", endpoint).json()