list_documents
Retrieve documents from Humaans HRIS. Filter by person ID to find documents for a specific employee.
Instructions
List documents. Optionally filter by personId.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| person_id | No |
Implementation Reference
- humaans_mcp/server.py:406-409 (handler)The list_documents MCP tool handler function. It optionally filters by personId and calls client().list_page('/documents', ...) to fetch documents from the Humaans API.
@mcp.tool() async def list_documents(person_id: str | None = None) -> Any: """List documents. Optionally filter by personId.""" return await client().list_page("/documents", filters={"personId": person_id}, limit=250) - humaans_mcp/server.py:400-403 (registration)The @mcp.tool() decorator registers list_documents (and other tools) with the FastMCP server. The tool is defined as an async function and registered automatically via the decorator.
@mcp.tool() async def list_equipment(person_id: str | None = None) -> Any: """List equipment assigned to people. Optionally filter by personId.""" return await client().list_page("/equipment", filters={"personId": person_id}, limit=250) - humaans_mcp/client.py:45-55 (helper)The list_page helper method on HumaansClient that list_documents calls. It constructs query parameters ($limit, $skip, filters) and performs an HTTP GET request to the given API path.
async def list_page( self, path: str, filters: dict[str, Any] | None = None, limit: int = 100, skip: int = 0, ) -> Any: params = dict(filters or {}) params["$limit"] = limit params["$skip"] = skip return await self.get(path, params) - humaans_mcp/client.py:34-43 (helper)The get helper method that executes the actual HTTP GET request and handles error responses. Called by list_page.
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()