get_legal_institutions
Retrieve comprehensive list of Polish legal institutions including ministries, authorities, and organizations involved in issuing or affected by legal acts.
Instructions
Get list of all institutions involved in Polish legal acts (ministries, authorities, organizations that issue or are affected by laws).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- app.py:771-805 (handler)The handler function `get_institutions_list` that implements the tool logic by fetching a list of legal institutions from the Sejm API.def get_institutions_list() -> list[str]: """Fetches a list of all institutions involved in legal acts. Retrieves the complete list of institutions, ministries, authorities, and organizations that are involved in creating, issuing, or being affected by Polish legal acts. This includes government bodies, ministries, regulatory authorities, and other entities. Returns: list[str]: List of institution names in Polish, representing all entities involved in the legal process. Returns empty list if request fails. Examples: User asks: "What institutions are involved in legal acts?": Returns: ['MIN. SPRAWIEDLIWOŚCI', 'MIN. FINANSÓW', 'MIN. ZDROWIA', 'SEJM', ...] User asks: "Show me all institutions that create laws": Returns: ['Prezydent', 'Rada Ministrów', 'Ministerstwa', 'Sejm', ...] User asks: "What organizations issue legal documents?": Returns: ['MIN. EDUKACJI NARODOWEJ', 'MIN. OBRONY NARODOWEJ', 'NBP', ...] User asks: "List all authorities involved in Polish legislation": Returns: ['Sejm RP', 'Senat RP', 'Prezydent RP', 'Rada Ministrów', ...] User asks: "What bodies can pass laws in Poland?": Returns: ['PARLAMENT', 'PREZYDENT', 'RADA MINISTRÓW', 'MINISTERSTWA', ...] """ logger.debug("get_institutions_list called") try: url = "https://api.sejm.gov.pl/eli/institutions" response = requests.get(url, headers={"Accept": "application/json"}) response.raise_for_status() data = response.json() logger.info(f"get_institutions_list retrieved {len(data)} institutions") return data except Exception as e: logger.error(f"Error: {e}") return []
- app.py:766-770 (registration)The @app.tool decorator registers the `get_legal_institutions` tool with its name, description, and tags.@app.tool( name="get_legal_institutions", description="Get list of all institutions involved in Polish legal acts (ministries, authorities, organizations that issue or are affected by laws).", tags={"metadata", "institutions", "reference", "legal-analysis"} )