get_compensation
Retrieve a single compensation record by its ID. Access employee compensation details from the Humaans HRIS.
Instructions
Retrieve a single compensation record by id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| compensation_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- humaans_mcp/server.py:305-308 (handler)The get_compensation tool implementation: an async function decorated with @mcp.tool() that takes a compensation_id string and delegates to client().get() on the /compensations/{compensation_id} endpoint.
@mcp.tool() async def get_compensation(compensation_id: str) -> dict[str, Any]: """Retrieve a single compensation record by id.""" return await client().get(f"/compensations/{compensation_id}") - humaans_mcp/server.py:305-305 (registration)The tool is registered via the @mcp.tool() decorator on line 305, where mcp = FastMCP('humaans') is defined at line 7.
@mcp.tool() - humaans_mcp/server.py:11-15 (helper)The client() helper function that lazily instantiates and returns a HumaansClient singleton, used by get_compensation to make the API call.
def client() -> HumaansClient: global _client if _client is None: _client = HumaansClient() return _client - humaans_mcp/client.py:34-43 (helper)The HumaansClient.get() method used by get_compensation to perform the actual HTTP GET request to the Humaans API.
async def get(self, path: str, params: dict[str, Any] | None = None) -> Any: clean = {k: v for k, v in (params or {}).items() if v is not None} resp = await self._client.get(path, params=clean) if resp.status_code >= 400: try: body = resp.json() except Exception: body = resp.text raise HumaansError(resp.status_code, path, body) return resp.json()