Skip to main content
Glama

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
NameRequiredDescriptionDefault
company_idNo
employee_idNo

Implementation Reference

  • 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()
  • 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)

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/mz462/mcpPaylocity'

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