get_legal_types
Retrieve all document types used in the Polish legal system, including laws, regulations, and ordinances, for legal research and analysis.
Instructions
Retrieve all document types (laws, regulations, ordinances, etc.) used in Polish legal system.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- app.py:730-764 (handler)The main handler function for the 'get_legal_types' tool. It makes an HTTP GET request to the Sejm API endpoint for legal types and returns the list of types as a list of strings. Includes error handling to return an empty list on failure.def get_types_list() -> list[str]: """Fetches a list of all possible legal act document types. Retrieves the complete classification of legal document types used in the Polish legal system, including laws, regulations, ordinances, announcements, and other legal instruments. This vocabulary is essential for filtering and categorizing documents. Returns: list[str]: List of document type strings in Polish, representing all possible legal act types. Returns empty list if request fails. Examples: User asks: "What types of legal acts exist?": Returns: ['Ustawa', 'Rozporządzenie', 'Obwieszczenie', 'Zarządzenie', ...] User asks: "Show me all document types available": Returns: ['ustawa', 'rozporządzenie', 'obwieszczenie', 'zarządzenie', ...] User asks: "What kinds of legal documents are there?": Returns: ['akt normatywny', 'akt indywidualny', 'akt prawa miejscowego', ...] User asks: "List all types of Polish legal acts": Returns: ['konstytucja', 'ustawa', 'rozporządzenie', 'uchwała', ...] User asks: "What categories of laws exist in Poland?": Returns: ['akty normatywne', 'akty indywidualne', 'akty prawa wewnętrznego', ...] """ logger.debug("get_types_list called") try: url = "https://api.sejm.gov.pl/eli/types" response = requests.get(url, headers={"Accept": "application/json"}) response.raise_for_status() data = response.json() logger.info(f"get_types_list retrieved {len(data)} types") return data except Exception as e: logger.error(f"Error: {e}") return []
- app.py:725-729 (registration)The @app.tool decorator that registers the 'get_types_list' function as the MCP tool named 'get_legal_types' with description and tags.@app.tool( name="get_legal_types", description="Retrieve all document types (laws, regulations, ordinances, etc.) used in Polish legal system.", tags={"metadata", "types", "reference", "legal-analysis"} )