Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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"}
    )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states 'Retrieve all document types' but doesn't disclose behavioral traits like whether this is a cached list, real-time query, paginated, rate-limited, or authentication requirements. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves operationally.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Retrieve all document types') and adds clarifying context ('used in Polish legal system') with examples. Every word earns its place, with no redundancy or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, 100% schema coverage, and an output schema exists, the description is minimally complete. However, with no annotations and no output details in the description, it lacks context about return format (e.g., list structure, example values) and behavioral constraints. For a simple retrieval tool, this is adequate but leaves room for improvement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (empty schema). The description doesn't need to explain parameters, and it appropriately doesn't mention any. Baseline for 0 parameters is 4, as there's no parameter information to add beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Retrieve') and resource ('all document types used in Polish legal system'), with specific examples (laws, regulations, ordinances). It distinguishes from siblings like get_legal_institutions or get_legal_keywords by focusing on document types rather than institutions or keywords. However, it doesn't explicitly differentiate from get_legal_statuses or other legal metadata tools, keeping it at 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like search_legal_acts or get_act_comprehensive_details. It doesn't mention prerequisites, timing considerations, or exclusions. The agent must infer usage from the purpose alone, which is insufficient for optimal tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/numikel/law-scrapper-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server