Skip to main content
Glama

get_legal_keywords

Retrieve available keywords for categorizing Polish legal acts to understand document topics and enable precise legal searches.

Instructions

Retrieve all available keywords for categorizing Polish legal acts. Essential for understanding document topics and enabling precise searches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • app.py:171-208 (handler)
    The handler function get_keywords_list() that implements the core logic of fetching keywords from the Sejm API. It makes a GET request to https://api.sejm.gov.pl/eli/keywords, parses the JSON response, and returns the list of keywords or an empty list on error.
    def get_keywords_list() -> list[str]:
        """Retrieves a list of all available keywords for law acts from the Sejm API.
    
        Keywords are used to categorize and filter legal acts by topic, subject matter,
        and legal domain. This function provides the complete vocabulary for advanced
        legal document searches and classification.
    
        Returns:
            list[str]: List of keywords used to categorize law acts, or empty list if request fails.
    
        Examples:
            User asks: "What keywords are available for searching law acts?":
                Returns: ['sąd', 'podatek', 'prawo', ...]
            User asks: "Show me all possible keywords for legal documents":
                Returns: ['administracja', 'zdrowie', 'edukacja', ...]
            User asks: "What topics can I search for in law acts?":
                Returns: ['gospodarka', 'środowisko', 'transport', ...]
            User asks: "Give me the complete list of keywords":
                Returns: ['prawo pracy', 'podatki', 'ochrony zdrowia', ...]
            User asks: "What categories exist for Polish legal acts?":
                Returns: ['sądownictwo', 'administracja publiczna', 'prawo karne', ...]
            User asks: "I need keywords for environmental law acts":
                Returns: ['środowisko', 'ochrona przyrody', 'gospodarka odpadami', ...]
            User asks: "Show me keywords related to education":
                Returns: ['szkolnictwo', 'edukacja', 'nauka', 'uczelnie', ...]
        """
        logger.debug("get_keywords_list called")
        try:
            url = "https://api.sejm.gov.pl/eli/keywords"
            logger.debug(f"Making GET request to: {url}")
            response = requests.get(url, headers={"Accept": "application/json"})
            response.raise_for_status()  # Raise exception for bad status codes
            data = response.json()
            logger.info(f"get_keywords_list retrieved {len(data)} keywords")
            return data
        except Exception as e:
            logger.error(f"Error: {e}")
            return []
  • app.py:166-170 (registration)
    The @app.tool decorator that registers the get_keywords_list function as the MCP tool named 'get_legal_keywords' with description and tags.
    @app.tool(
        name="get_legal_keywords",
        description="Retrieve all available keywords for categorizing Polish legal acts. Essential for understanding document topics and enabling precise searches.",
        tags={"metadata", "keywords", "reference", "search-filters"}
    )
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool retrieves keywords but doesn't describe traits like whether it's read-only, if it requires authentication, rate limits, or how the data is structured. This leaves significant gaps for an agent to understand the tool's behavior beyond its basic purpose.

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

Conciseness4/5

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

The description is concise and front-loaded, with two sentences that efficiently convey the tool's purpose and value. Every sentence adds meaningful information without waste, though it could be slightly more structured by explicitly separating purpose from usage benefits.

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 reasonably complete for its simplicity. However, it lacks details on behavioral aspects like data format or access constraints, which are important for full context. It's adequate but has clear gaps in transparency.

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%, so there's no need for parameter details in the description. The description appropriately doesn't discuss parameters, focusing on the tool's purpose instead. A baseline of 4 is given as it compensates well for the lack of parameters by being clear about what the tool does.

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 tool's purpose with a specific verb ('Retrieve') and resource ('keywords for categorizing Polish legal acts'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'get_legal_types' or 'get_legal_statuses', which might also retrieve categorization metadata, so it doesn't reach the highest score.

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

Usage Guidelines3/5

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

The description implies usage context by stating it's 'essential for understanding document topics and enabling precise searches,' which suggests when to use it. However, it lacks explicit guidance on when not to use it or alternatives, such as whether other tools might provide overlapping or more specific keyword data, so it's only adequate.

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