get_legal_statuses
Retrieve all legal act status types like active, repealed, or consolidated to classify and filter Polish legal documents from Dziennik Ustaw and Monitor Polski.
Instructions
Get all possible legal act statuses (active, repealed, consolidated, etc.) for document classification and filtering.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- app.py:689-723 (handler)The main handler function that executes the tool logic for get_legal_statuses. It makes an API request to fetch the list of all possible legal act statuses from the Sejm API and returns them as a list of strings, handling errors gracefully.def get_statuses_list() -> list[str]: """Fetches a list of all possible legal act statuses. Retrieves the complete vocabulary of legal act statuses used in the Polish legal system, including active, repealed, consolidated, and other status classifications. This is essential for filtering and understanding the current legal standing of documents. Returns: list[str]: List of status strings in Polish, representing all possible legal act statuses. Returns empty list if request fails. Examples: User asks: "What are the possible act statuses?": Returns: ['akt indywidualny', 'akt jednorazowy', 'akt objęty tekstem jednolitym', ...] User asks: "Show me all legal act status types": Returns: ['obowiązujący', 'uchylony', 'wygaśnięcie aktu', ...] User asks: "What statuses can a Polish law have?": Returns: ['akt obowiązujący', 'akt uchylony', 'tekst jednolity', ...] User asks: "List all possible statuses for legal documents": Returns: ['aktywny', 'nieaktywny', 'zmieniony', ...] User asks: "What are the different states a law can be in?": Returns: ['obowiązujący', 'uchylony', 'wygaśnięty', ...] """ logger.debug("get_statuses_list called") try: url = "https://api.sejm.gov.pl/eli/statuses" response = requests.get(url, headers={"Accept": "application/json"}) response.raise_for_status() data = response.json() logger.info(f"get_statuses_list retrieved {len(data)} statuses") return data except Exception as e: logger.error(f"Error: {e}") return []
- app.py:684-688 (registration)The registration of the get_legal_statuses tool using the @app.tool decorator, specifying the name, description, and tags.@app.tool( name="get_legal_statuses", description="Get all possible legal act statuses (active, repealed, consolidated, etc.) for document classification and filtering.", tags={"metadata", "statuses", "reference", "legal-analysis"} )