get_legal_publishers
Retrieve metadata and publication years for Polish legal act publishers like Dziennik Ustaw and Monitor Polski to support legal research.
Instructions
Get list of all legal act publishers (Dziennik Ustaw, Monitor Polski) with their metadata and publication years.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- app.py:331-367 (handler)The handler function `get_publishers_list` that implements the core logic of fetching the list of legal publishers from the Sejm API endpoint https://api.sejm.gov.pl/eli/acts. It returns a list of publisher metadata or empty list on error.def get_publishers_list() -> list: """Fetches a list of all available legal act publishers (journals) from the Sejm API. Publishers are the official gazettes where legal acts are published in Poland. The main publishers are Dziennik Ustaw (DU) and Monitor Polski (MP), each containing different types of legal documents with their own numbering systems. Returns: list: A list of publisher objects containing code, name, shortName, actsCount, and years. Returns empty list if request fails. Examples: User asks: "What publishers are available?": Returns: [{'code': 'DU', 'name': 'Dziennik Ustaw', 'actsCount': 96086}, {'code': 'MP', 'name': 'Monitor Polski', 'actsCount': 65485}] User asks: "Show me all legal act publishers": Returns: [{'code': 'DU', 'name': 'Dziennik Ustaw', 'actsCount': 96086}, ...] User asks: "What journals publish Polish law acts?": Returns: [{'code': 'DU', 'name': 'Dziennik Ustaw', 'actsCount': 96086}, {'code': 'MP', 'name': 'Monitor Polski', 'actsCount': 65485}] User asks: "List all available publishers": Returns: [{'code': 'DU', 'name': 'Dziennik Ustaw', 'actsCount': 96086}, {'code': 'MP', 'name': 'Monitor Polski', 'actsCount': 65485}] User asks: "What sources contain Polish legal acts?": Returns: [{'code': 'DU', 'name': 'Dziennik Ustaw', 'actsCount': 96086}, {'code': 'MP', 'name': 'Monitor Polski', 'actsCount': 65485}] """ logger.debug("get_publishers_list called") try: url = "https://api.sejm.gov.pl/eli/acts" logger.debug(f"Making GET request to: {url}") response = requests.get(url, headers={"Accept": "application/json"}) response.raise_for_status() data = response.json() logger.info(f"get_publishers_list retrieved {len(data)} publishers") return data except Exception as e: logger.error(f"Error: {e}") return []
- app.py:326-330 (registration)The FastMCP tool registration decorator that registers the `get_legal_publishers` tool with name, description, and tags.@app.tool( name="get_legal_publishers", description="Get list of all legal act publishers (Dziennik Ustaw, Monitor Polski) with their metadata and publication years.", tags={"metadata", "publishers", "reference", "sources"} )