fetch_employee_earnings
Retrieve earnings data for a specific employee from Paylocity, enabling payroll verification and compensation analysis.
Instructions
Fetch earnings data 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 earnings for.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_id | No | ||
| employee_id | No |
Implementation Reference
- src/mcppaylocity/__init__.py:260-274 (handler)The MCP tool handler for 'fetch_employee_earnings'. This function validates input, selects company ID if not provided, and delegates to PaylocityClient.get_employee_earnings to fetch the data.@mcp.tool() def fetch_employee_earnings(company_id: Optional[Union[str, int]] = None, employee_id: Union[str, int] = None) -> Dict[str, Any]: """ Fetch earnings data 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 earnings 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_earnings(company_id_str, employee_id_str)
- Helper method in PaylocityClient that constructs the API endpoint and makes the authenticated GET request to retrieve employee earnings data from Paylocity API.def get_employee_earnings(self, company_id, employee_id): """Get all earnings for a specific employee""" endpoint = "/api/v2/companies/{}/{}/earnings".format(company_id, employee_id) return self._make_request("GET", endpoint).json()
- src/mcppaylocity/__init__.py:260-274 (registration)The @mcp.tool() decorator registers this function as an MCP tool named 'fetch_employee_earnings'.@mcp.tool() def fetch_employee_earnings(company_id: Optional[Union[str, int]] = None, employee_id: Union[str, int] = None) -> Dict[str, Any]: """ Fetch earnings data 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 earnings 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_earnings(company_id_str, employee_id_str)