get_act_comprehensive_details
Retrieve complete legal act details including metadata, status, dates, and references for Polish legislation from Dziennik Ustaw and Monitor Polski.
Instructions
Get complete detailed information about a specific legal act including metadata, status, dates, and references.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| publisher | Yes | Publisher code (DU for Dziennik Ustaw, MP for Monitor Polski) | |
| year | Yes | Publication year | |
| num | Yes | Act number/position within the year |
Implementation Reference
- app.py:474-519 (handler)The handler function `get_act_details` that implements the tool logic: constructs the Sejm API URL from publisher/year/num parameters and fetches comprehensive act details (metadata, status, dates, references). Handles errors by returning empty dict.def get_act_details( publisher: Annotated[str, "Publisher code (DU for Dziennik Ustaw, MP for Monitor Polski)"], year: Annotated[int, "Publication year"], num: Annotated[Union[int, str], "Act number/position within the year"] ) -> dict: """Fetches detailed information about a specific legal act from the Sejm API. Retrieves comprehensive metadata for a specific legal act including its title, type, publication dates, effective dates, current status, and other legal attributes. This is essential for legal research and document analysis. Args: publisher: Publication code (e.g., 'DU' for Dziennik Ustaw, 'MP' for Monitor Polski). year: Year of publication as integer. num: Act number/position within the year as integer or string. Returns: dict: Detailed information about the legal act containing ELI identifier, title, type, status, dates, and other metadata. Returns empty dict if act not found. Examples: User asks: "Get details for DU/2020/1280": Parameters: publisher = 'DU', year = 2020, num = 1280 Returns: {'ELI': 'DU/2020/1280', 'title': '...', 'type': 'Obwieszczenie', 'inForce': 'NOT_IN_FORCE', ...} User asks: "Show me information about act MP/2023/45": Parameters: publisher = 'MP', year = 2023, num = 45 User asks: "What is the status of DU/2019/100?": Parameters: publisher = 'DU', year = 2019, num = 100 User asks: "Give me full details of act DU/2022/500": Parameters: publisher = 'DU', year = 2022, num = 500 User asks: "Tell me about the legal act DU/2021/250": Parameters: publisher = 'DU', year = 2021, num = 250 """ logger.debug(f"get_act_details called with: publisher={publisher}, year={year}, num={num}") try: url = f"https://api.sejm.gov.pl/eli/acts/{publisher}/{year}/{num}" 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_act_details retrieved details for act: {publisher}/{year}/{num}") return data except Exception as e: logger.error(f"Error: {e}") return {}
- app.py:469-473 (registration)FastMCP tool registration decorator that binds the `get_act_details` function to the tool name 'get_act_comprehensive_details' with description and tags.@app.tool( name="get_act_comprehensive_details", description="Get complete detailed information about a specific legal act including metadata, status, dates, and references.", tags={"analysis", "details", "act-info", "legal-research"} )
- app.py:475-477 (schema)Input schema defined by function parameters with type annotations and descriptions, specifying the required inputs for the tool.publisher: Annotated[str, "Publisher code (DU for Dziennik Ustaw, MP for Monitor Polski)"], year: Annotated[int, "Publication year"], num: Annotated[Union[int, str], "Act number/position within the year"]