Skip to main content
Glama

fetch_company_codes

Retrieve company-specific codes for resources like earnings or deductions from Paylocity. Specify a company ID and code resource to access structured data.

Instructions

Fetch company codes for a specific resource.

Args: company_id: Optional company ID (string or integer). If not provided, uses the first company ID from configuration. code_resource: Code resource to fetch (e.g., 'earnings', 'deductions', 'costcenter1', etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
company_idNo
code_resourceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'fetch_company_codes'. Validates input parameters and calls PaylocityClient.get_company_codes to fetch the data. The @mcp.tool() decorator registers it with the MCP server.
    @mcp.tool()
    def fetch_company_codes(company_id: Optional[Union[str, int]] = None, code_resource: str = None) -> Dict[str, Any]:
        """
        Fetch company codes for a specific resource.
        
        Args:
            company_id: Optional company ID (string or integer). If not provided, uses the first company ID from configuration.
            code_resource: Code resource to fetch (e.g., 'earnings', 'deductions', 'costcenter1', etc.)
        """
        if code_resource is None:
            raise ValueError("code_resource is required")
            
        company_id_str = str(company_id) if company_id is not None else company_ids[0]
        return client.get_company_codes(company_id_str, code_resource)
  • Supporting method in PaylocityClient class that constructs the API endpoint and performs the authenticated GET request to retrieve company codes, using the internal _make_request method which handles retries and token management.
    def get_company_codes(self, company_id, code_resource):
        """Get company codes for a specific resource"""
        endpoint = "/api/v2/companies/{}/codes/{}".format(company_id, code_resource)
        return self._make_request("GET", endpoint).json()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that company_id defaults to the first company ID from configuration if not provided, which adds some context. However, it fails to describe critical behaviors such as authentication needs, rate limits, error handling, or what the output looks like, leaving significant gaps for a tool with parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose. The 'Args' section is structured for clarity, though it could be more integrated into the main text. No wasted sentences, but minor improvements in flow could enhance readability.

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 2 parameters with 0% schema coverage and an output schema present, the description adds some parameter semantics but lacks behavioral context like authentication or error handling. The output schema reduces the need to explain return values, but overall completeness is moderate due to missing operational details.

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?

Schema description coverage is 0%, so the description must compensate. It provides meaningful semantics for both parameters: company_id is optional with a default behavior, and code_resource includes examples like 'earnings' and 'deductions'. This adds value beyond the bare schema, though it could elaborate on code_resource constraints or formats.

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 verb 'fetch' and the resource 'company codes', making the purpose understandable. It distinguishes from sibling tools like 'fetch_employee_details' by focusing on company-level codes rather than employee data. However, it doesn't explicitly contrast with all siblings, missing a perfect score.

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

Usage Guidelines3/5

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

The description implies usage through the 'Args' section, suggesting when to provide company_id and code_resource, but lacks explicit guidance on when to use this tool versus alternatives like 'fetch_employee_earnings'. No when-not-to-use scenarios or prerequisites are mentioned, leaving room for ambiguity.

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