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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description states it 'fetches' data, implying a read-only operation, but doesn't specify authentication requirements, rate limits, error conditions, or what format the earnings data returns. With an output schema present, some behavioral aspects might be covered there, but the description itself lacks critical operational context for a tool with no annotation coverage.

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?

The description is extremely concise and well-structured. The first sentence clearly states the tool's purpose, followed by a bullet-point style 'Args' section that efficiently explains each parameter. Every sentence earns its place with no wasted words, making it easy to scan and understand quickly.

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

Completeness3/5

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

Given that there's an output schema (which should document return values), no annotations, and 2 parameters with good semantic coverage in the description, the description is moderately complete. However, for a data-fetching tool with sibling alternatives, it should ideally clarify what 'earnings data' includes versus other employee financial tools. The presence of an output schema raises the baseline, but the lack of usage differentiation keeps this from being fully complete.

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?

The description adds significant value beyond the input schema, which has 0% description coverage. It explains that 'company_id' is optional and defaults to the first company ID from configuration, and that 'employee_id' is required to get earnings for a specific employee. This clarifies the purpose and default behavior of both parameters, compensating well for the schema's lack of descriptions.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Fetch earnings data for a specific employee.' This is a specific verb ('fetch') + resource ('earnings data') + target ('specific employee'). However, it doesn't explicitly distinguish this from sibling tools like 'fetch_employee_paystatement_details' or 'fetch_employee_details', which might also retrieve employee financial information.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'fetch_employee_paystatement_details' or 'fetch_employee_details', nor does it explain what distinguishes 'earnings data' from other employee financial data. The only usage context is in the Args section about parameter defaults, which doesn't address tool selection.

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

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