list_public_holidays
Retrieve public holidays by calendar ID and year. Filter results to plan time away or comply with local regulations.
Instructions
List public holidays. Optional filters: calendarId, year.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calendar_id | No | ||
| year | No |
Implementation Reference
- humaans_mcp/server.py:368-375 (handler)The async function that executes the 'list_public_holidays' tool logic. Calls the HumaansClient's list_page method with the '/public-holidays' endpoint, passing optional filters for calendar_id and year.
@mcp.tool() async def list_public_holidays(calendar_id: str | None = None, year: int | None = None) -> Any: """List public holidays. Optional filters: calendarId, year.""" return await client().list_page( "/public-holidays", filters={"publicHolidayCalendarId": calendar_id, "year": year}, limit=250, ) - humaans_mcp/server.py:368-368 (registration)The tool is registered via the @mcp.tool() decorator on the list_public_holidays function, which registers it with the FastMCP server.
@mcp.tool() - humaans_mcp/server.py:11-15 (helper)The client() helper function (singleton) returns a HumaansClient instance that list_public_holidays calls to make the API request.
def client() -> HumaansClient: global _client if _client is None: _client = HumaansClient() return _client - humaans_mcp/client.py:45-55 (helper)HumaansClient.list_page - the method used by list_public_holidays to fetch paginated data from the API endpoint with filters.
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)